dale_j1992
Registered User.
- Local time
- Today, 10:27
- Joined
- Sep 23, 2016
- Messages
- 26
Good Afternoon Everyone.
I am relatively new to VBA, so any help would be greatly appreciated .
I have got a database where there is two options to LOG in, one being a password the other is done using a RFID CARD, this is all working perfectly.
My issue comes when i need to isolate what each user can access within my data base, i have got code that works for either or but i dont understand how to write the code to work with both methods.
The two codes are
1.
If DLookup("[AccessLevelID]", "tblUser", "[UserID] = " & Forms!frmLogin!cboUser) = 1 Then
DoCmd.OpenForm "Admin MENU", acNormal
DoCmd.Close acForm, "Main Menu", acSaveYes
Else
MsgBox "You do not have Access to this Form!", vbOKOnly
2.
If Forms!RFIDLOGIN!ACCESSLVL = 1 Then
DoCmd.OpenForm "Admin MENU", acNormal
DoCmd.Close acForm, "Main Menu", acSaveYes
Else
MsgBox "You do not have Access to this Form!", vbOKOnly
I need to somehow combined the two options so if the first was not the method used to sign in it will continue with the vba and use the second option.
many thanks in advance.
kind regards
I am relatively new to VBA, so any help would be greatly appreciated .
I have got a database where there is two options to LOG in, one being a password the other is done using a RFID CARD, this is all working perfectly.
My issue comes when i need to isolate what each user can access within my data base, i have got code that works for either or but i dont understand how to write the code to work with both methods.
The two codes are
1.
If DLookup("[AccessLevelID]", "tblUser", "[UserID] = " & Forms!frmLogin!cboUser) = 1 Then
DoCmd.OpenForm "Admin MENU", acNormal
DoCmd.Close acForm, "Main Menu", acSaveYes
Else
MsgBox "You do not have Access to this Form!", vbOKOnly
2.
If Forms!RFIDLOGIN!ACCESSLVL = 1 Then
DoCmd.OpenForm "Admin MENU", acNormal
DoCmd.Close acForm, "Main Menu", acSaveYes
Else
MsgBox "You do not have Access to this Form!", vbOKOnly
I need to somehow combined the two options so if the first was not the method used to sign in it will continue with the vba and use the second option.
many thanks in advance.
kind regards