If you're using Microsoft Security to protect your database, some of your users will get a standard message box when they try to open a form they don't have authorization to access. This traps the error and provides a chance for you customize the message.
Insert this code into the on click procedure of the button that opens the form.
Private Sub cmdbutton_Click()
On Error GoTo ErrorcmdButton
DoCmd.OpenForm "frmName", acNormal
ExitcmdButton:
Exit Sub
ErrorcmdButton:
' Traps permissions error message
If Err = 2603 Then
MsgBox "You do not have access to this department's records"
Resume ExitcmdButton
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.