I need to set two global values after a successful password.
These values will determine the rights for each staff.
But I am having difficulty achieving this.
StaffType is a number to determine level of security
CurrentStaff is pointer to staff name.
Your help is appreciated
This is my module
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Global StaffType As Long
- Global CurrentStaff As Long
- Public Sub init_Globals()
- StaffType = 0
- CurrentStaff = 0
- End Sub
if I remove lines 5,6, 7 - all works except my variables are not set to what I want.
Expand|Select|Wrap|Line Numbers
- Private Sub EnterPassword_AfterUpdate()
- If Me.EnterPassword = Me.StaffPassword Then
- MsgBox "MATCH"
- CurrentStaff = Me.StaffID
- StaffType = Me.StaffTypeID
- MsgBox StaffType & " " & CurrentStaff
- DoCmd.Close acForm, "StaffPasswordCheck", acSaveNo
- DoCmd.OpenForm "Switchboard"
- Else
- MsgBox "Incorrect: Please Re-Enter"
- Me.EnterPassword.SetFocus
- End If
- End Sub
- Private Sub EnterPassword_Enter()
- If IsNull(Me.cmbUsername) Then
- Me.cmbUsername.SetFocus
- End If
- End Sub
- Private Sub Form_Open(Cancel As Integer)
- Call init_Globals
- End Sub