Hello
i have this vba code that is supposed to resrtict access to users based on their access level what i have is a table that shows the access level and the forms they have access to and a tick box that says whether they have access to that form. now the problem im finding is that if i give them access to one form it will give them access to all forms but if i put in the hasaccess table that they dont have access to a form then they cannot access any forms :/
it feels like if its not finding the formname then its looking for the closest match im not sure though could anyone advise me on how i can fix this
i have this vba code that is supposed to resrtict access to users based on their access level what i have is a table that shows the access level and the forms they have access to and a tick box that says whether they have access to that form. now the problem im finding is that if i give them access to one form it will give them access to all forms but if i put in the hasaccess table that they dont have access to a form then they cannot access any forms :/
PHP:
If Nz(DLookup("hasaccess", "tblhasaccess", "accesslvl=" & TempVars("AccessLevel") & " AND formname='" & Me.Name & "'"), False) = False Then
MsgBox "You Do Not Have Access"
DoCmd.close acForm, "Palletinpter"
DoCmd.OpenForm ("PalletMenu")
End If
it feels like if its not finding the formname then its looking for the closest match im not sure though could anyone advise me on how i can fix this