I'm still trying to get my mind around the VBA coding but here is my question. I have a log on form that verifies a user based on a user name and password table. How can I save the log in name for global use in other forms - i.e. to recheck permissions based on admin or not so that an administrative form will open if they have rights. I know it should be a global variable instead of private but not sure how to do it.
I hope this makes since. I was using this type of statement to open a normal form or an admin form but reconfigured database so everyone opens frmUser and added a button for admin to select to open special form.
Dim iEmp As Long
iEmp = Me.cboEmployee
DoCmd.close acForm, "frmStartUp", acSaveNo
If Nz(DLookup("Admin", "Technicians", "[ID]=" & iEmp), 0) Then
DoCmd.OpenForm "frmAdm"
Else
DoCmd.OpenForm "frmUser"
End If
I hope this makes since. I was using this type of statement to open a normal form or an admin form but reconfigured database so everyone opens frmUser and added a button for admin to select to open special form.
Dim iEmp As Long
iEmp = Me.cboEmployee
DoCmd.close acForm, "frmStartUp", acSaveNo
If Nz(DLookup("Admin", "Technicians", "[ID]=" & iEmp), 0) Then
DoCmd.OpenForm "frmAdm"
Else
DoCmd.OpenForm "frmUser"
End If