Below is the code I used but logged in as a Data Entrant, I can still delete a record. Sigh! I feel like I've run a marathon and still come to the same position. I guess I'll just have to Set the darn Form property AllowDeletions to No
dim UserLevel blah blah
dim CatID bla blah
UserLevel = DLookup("AccessLevelID", "tblUser", "strPassword='" & Forms!frmLogin.txtPassword & "'")
CatID = DLookup("CategoryID", "tblUser", "strPassword='" & Forms!frmLogin.txtPassword & "'")
SELECT Case CatIDCase 111
With Me
If userlevel = 1 then
.... 'Code goes here for "Admn"
Elseif userlevel = 2
... 'Code goes here for "Dev"
End If
End with
Case 122
With Me
If userlevel = 4 then
... 'Code goes here for "Data"
Elseif userlevel = 5
... 'Code goes here for "Reader"
MsgBox "You are not authorized to view this form"
Cancel = True
DoCmd.Close acForm, Me.Name
Forms!frmLogin.Visible = True
End Select