Database Security Demo

jonamua1971

Registered User.
Local time
Today, 10:59
Joined
Mar 3, 2007
Messages
97
Any help will be highly apprecited.
i found a security demo databse on this forum and it is excellent but i need help with the codes to put on forms as they load.
1.Admin.acts as the over all adminstrator for the database. Has full controll over all data and objects contained in the database.
2.Manager>Has full access to data but is limited to their section.
3.Supervisor:Has view access to data but is limited to their section.
4.User:Has acccess to select data and is limited to their Office.
5.Guest:Has view control to data only
samples of code
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
    
    If User.AccessID = 1 Then
 'Here list all buttons that should be anabled for Admin only
        Me.cmdAdmin.Enabled = True
    Else
        Me.cmdAdmin.Enabled = False
    End If

    If User.AccessID = >1 Then
 'Here list all buttons that should be enabled for level 2 only
        Me.cmdbutton.Enabled = True
    Else
        Me.cmdbutton.Enabled = False
    End If
    
Exit_Form_Open:
    Exit Sub
Err_Form_Open:
    MsgBox Err.Description
    Me.Visible = True
    Resume Exit_Form_Open
 
Not quite sure what you are asking for help for. I would use a Select Case to find the AccessID value and then set things accordingly.

I don't think any of us can tell you what to put in each of the spots because it is solely dependent on what form/forms you are going to be using, when you are using them, etc.
 

Users who are viewing this thread

Back
Top Bottom