Pauline123
Registered User.
- Local time
- Today, 04:27
- Joined
- Apr 1, 2013
- Messages
- 69
Hi, hope someone can help - I am trying to restrict access to users to prevent Level 1 users from gaining access to all the workings eg tables, queries and forms.
I have a security table and a login form which brings each user to a specified switchboard showing command buttons to specific forms.
But I cannot figure out a way to stop them from closing the switchboard and therefore gaining access to the entire database including the forms etc they are not allowed to access.
I have tried using the Pop Up function but when the command buttons are activated to open the selected form it opens behind the switchboard.
If I do set the switchboard so new forms open the user can still gain access to areas of the database.
Did try VBA coding as follows in the On Load event of a form:
If Forms!frmLogin!cboUser.Column(4) <> 1 Then
MsgBox “You are not authorized to open this form!”, vbOkOnly
DoCmd.Close acForm, “Customers Orders”
End If
But it failed to work - kept saying could not find the frmLogin form but this is present in my database.
Tried:
If Forms!frmLogin!cboUser.Column(4) <> 1 Then
DoCmd.Close acForm, Me.Customers Orders
MsgBox “You are not authorized to open this form!”, _
vbCritical, "Security Violation"
End If
but again it either said it could not find the Login form or had trouble with the form Customers Orders
Can anyone help me out - this is the final stage of completing my database.
Pauline
I have a security table and a login form which brings each user to a specified switchboard showing command buttons to specific forms.
But I cannot figure out a way to stop them from closing the switchboard and therefore gaining access to the entire database including the forms etc they are not allowed to access.
I have tried using the Pop Up function but when the command buttons are activated to open the selected form it opens behind the switchboard.
If I do set the switchboard so new forms open the user can still gain access to areas of the database.
Did try VBA coding as follows in the On Load event of a form:
If Forms!frmLogin!cboUser.Column(4) <> 1 Then
MsgBox “You are not authorized to open this form!”, vbOkOnly
DoCmd.Close acForm, “Customers Orders”
End If
But it failed to work - kept saying could not find the frmLogin form but this is present in my database.
Tried:
If Forms!frmLogin!cboUser.Column(4) <> 1 Then
DoCmd.Close acForm, Me.Customers Orders
MsgBox “You are not authorized to open this form!”, _
vbCritical, "Security Violation"
End If
but again it either said it could not find the Login form or had trouble with the form Customers Orders
Can anyone help me out - this is the final stage of completing my database.
Pauline