J
Jack
What is the best way? Sample 1 or 2
Public Function UserSecurity()
On Error GoTo EndIt
Dim strSQL, strCurUserID As String
Dim rs As ADODB.Recordset
Dim cnn As ADODB.Connection
strCurUserID = ThisUser
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
strSQL = "SELECT tblSecurity.UserID, tblSecurity.
cmdCustomer from tblSecurity where UserID = '" &
strCurUserID & "'"
rs.Open strSQL, cnn, adOpenStatic, adLockReadOnly
On Error Resume Next
===========
Sample 1
============
If rs.Fields() = False Then
Forms![MainMenu]![cmdCustomer].Enabled = False
End If
==========
Sample 2
=========
If rs.Fields() = True Then
Forms![MainMenu]![cmdCustomer].Enabled = True
End If
Public Function UserSecurity()
On Error GoTo EndIt
Dim strSQL, strCurUserID As String
Dim rs As ADODB.Recordset
Dim cnn As ADODB.Connection
strCurUserID = ThisUser
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
strSQL = "SELECT tblSecurity.UserID, tblSecurity.
cmdCustomer from tblSecurity where UserID = '" &
strCurUserID & "'"
rs.Open strSQL, cnn, adOpenStatic, adLockReadOnly
On Error Resume Next
===========
Sample 1
============
If rs.Fields() = False Then
Forms![MainMenu]![cmdCustomer].Enabled = False
End If
==========
Sample 2
=========
If rs.Fields() = True Then
Forms![MainMenu]![cmdCustomer].Enabled = True
End If