I have a tUser table.
ID, PASS, RIGHTS
bsmith, bear123, "A"
when they click the button to open the form, it pulls their user id, and checks the password they enter.
then the Rights code , determines if they can view it. I put the codes on the forms TAG property. IF its there they can open it , edit , or view only depending on the code,
Code:
vUsr = Environ("Username")
if Dlookup("[UserID]","tUsers","[userid]='" & vUsr & "'") = vUsr then
if Dlookup("[Pass]","tUsers","[userid]='" & vUsr & "'") = txtPassword then
msgbox "Invalid password"
else
vRights = Dlookup("[Rights]","tUsers","[userid]='" & vUsr & "'")
docmd.openForm cboForm 'picked from a list
if forms(cboForm).Tag ,vRights) =0 then
docmd.close acForm, cboform
msgbox "No rights to this form"
else
'check other rights here
endif
endif
else
msgbox "User not on file"
endif