Hello. I am new to using Access so bare with me
I am working on a project for work that has me testing Access's built in security features. I used the Security Wizard to create groups and users. My problem came when I set up group permissions.
I want Access to display a message box letting users know they don't have permission to perform the function (in my case running a query) when they press a button on the switchboard. Note: I created the switchboard using Switchboard Manager.
I went into the VBA code for the switchboard in the Private Function HandleButtonClick(intBtn As Integer) section and modified the error message. The message box seems to work and even displays the message I wrote, until the user clicks on a button they don't have rights to more than 3 times. When a button or mutiple buttons are pushed in the switchboard that the user doens't have rights to it locks up the database and only lets them exit by clicking on the X at the top of the screen.
This is the code:
HandleButtonClick_Err:
' If the action was cancelled by the user for
' some reason, don't display an error message.
' Instead, resume on the next line.
If (Err = conErrDoCmdCancelled) Then
Resume Next
Else
MsgBox "You don't have rights to perform that function.", vbCritical
Resume HandleButtonClick_Exit
End If
Does anyone know a better way to handle this?
Thank you!
I am working on a project for work that has me testing Access's built in security features. I used the Security Wizard to create groups and users. My problem came when I set up group permissions.
I want Access to display a message box letting users know they don't have permission to perform the function (in my case running a query) when they press a button on the switchboard. Note: I created the switchboard using Switchboard Manager.
I went into the VBA code for the switchboard in the Private Function HandleButtonClick(intBtn As Integer) section and modified the error message. The message box seems to work and even displays the message I wrote, until the user clicks on a button they don't have rights to more than 3 times. When a button or mutiple buttons are pushed in the switchboard that the user doens't have rights to it locks up the database and only lets them exit by clicking on the X at the top of the screen.
This is the code:
HandleButtonClick_Err:
' If the action was cancelled by the user for
' some reason, don't display an error message.
' Instead, resume on the next line.
If (Err = conErrDoCmdCancelled) Then
Resume Next
Else
MsgBox "You don't have rights to perform that function.", vbCritical
Resume HandleButtonClick_Exit
End If
Does anyone know a better way to handle this?
Thank you!