I am creating a simple relational dbase using Access 97 (yes I know, But work won't upgrade it). We are using Windows NT and I have some code that I think may have come from this forum, that allows the database to select the user login ID from Windows NT. This is really handy because now I can determine what LEVEL of security each user has by deciding on what he can and cannot see by setting the attributes on each form eg if someone opens the database and is not in the user table, then he can only have veiw access because the forms are set so that there no Additions, deletions or edits.
My dilema, I am duplicating the same code for each form for the "on Load" event. I would like to write the code only once in a global module and refer to this on each form. The code that I am using is:
Private Sub Form_Load()
Dim Access1 As String
Access1 = [Forms]![frm_access]![Access]
Select Case Access1
Case "Developer"
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
Case "administrator"
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
Case "User"
Me.AllowAdditions = True
Case "nil"
DoCmd.OpenForm ("frm_application"
End Select
End Sub
How can I convert this code so that I can refer to it using any form in the database
Cheers
JEDEL
My dilema, I am duplicating the same code for each form for the "on Load" event. I would like to write the code only once in a global module and refer to this on each form. The code that I am using is:
Private Sub Form_Load()
Dim Access1 As String
Access1 = [Forms]![frm_access]![Access]
Select Case Access1
Case "Developer"
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
Case "administrator"
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
Case "User"
Me.AllowAdditions = True
Case "nil"
DoCmd.OpenForm ("frm_application"
End Select
End Sub
How can I convert this code so that I can refer to it using any form in the database
Cheers
JEDEL