okay this program is not allowing me to access the form even though I used the correct user login. Your help is greatly appreciated
'****If user has Administrator access level**************
If DLookup("admn", "tblUser", "userID= " & Forms!frmLogin.cmbUser) = True Then With Me
.DataEntry = True
.AllowEdits = True
.AllowDeletions = True
.AllowAdditions = True
.AllowFilters = True
End With
End If
'****If user has Data Entry access level*****************
If DLookup("data", "tblUser", "userID= " & Forms!frmLogin.cmbUser) = True AndIf DLookup("categoryID", "tblUser", "userID= " & Forms!frmLogin.cmbUser) = 133 Then
With Me
.DataEntry = True
.AllowEdits = True
.AllowDeletions = False
.AllowAdditions = True
.AllowFilters = False
End With
Else
MsgBox "You are not authorized to view this form"
Cancel = True
DoCmd.close acForm, "ObstcsForm"
End If
End If
'****If user has Read Only access level*****************
If DLookup("reado", "tblUser", "userID= " & Forms!frmLogin.cmbUser) = True And If DLookup("categoryID", "tblUser", "userID= " & Forms!frmLogin.cmbUser) = 133 Then
With Me
.DataEntry = False
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
.AllowFilters = True
End With
Else
MsgBox "You are not authorized to view this form"
Cancel = True
DoCmd.close acForm, "ObstcsForm"
End If
End If