Hi All
I have got some code for a form login screen, I am trying to add multiple account types but really struggling any suggestions would be great I would like for example
Admin
Standard
ViewOnly
FinanceOnly
I have got some code for a form login screen, I am trying to add multiple account types but really struggling any suggestions would be great I would like for example
Admin
Standard
ViewOnly
FinanceOnly
Code:
Private Sub frm1Btn_Click()
If IsNull(Me.tb_ID) Or IsNull(Me.tb_pwd) Then
MsgBox "You must enter password and login ID.", vbOKOnly + vbInformation, "Required Data"
Me.tb_ID.SetFocus
Exit Sub
End If
If Me.tb_pwd.Value = DLookup("[Login_Pwd]", "login_tbl", "[Empl ID]='" & Me.tb_ID.Value & "'") Then
If DLookup("[User_Type]", "login_tbl", "[Empl ID]='" & Me.tb_ID.Value & "'") = "Admin" Then
DoCmd.openForm "admin_menu"
DoCmd.Close acForm, "login", acSaveNo
Else
DoCmd.openForm "user_menu"
DoCmd.Close acForm, "login", acSaveNo
End If
Else
MsgBox "Password or login ID incorrect. Please Try Again", vbOKOnly + vbExclamation, "Invalid Entry!"
Me.tb_pwd.SetFocus
End If
End Sub