Good Morning VBA masters,
I have another problem aarrrhhhh, right I have a login screen for a new database I am creating, I have a table called "tbl logon" with the staff members and there passwords I have got this code which works fine if I just want them to close the logon screen and open the switchboard.
but what i really want is to open different switchboards for different users, i.e. admin, manager & engineer, Any ideas
here is my original code
I have another problem aarrrhhhh, right I have a login screen for a new database I am creating, I have a table called "tbl logon" with the staff members and there passwords I have got this code which works fine if I just want them to close the logon screen and open the switchboard.
but what i really want is to open different switchboards for different users, i.e. admin, manager & engineer, Any ideas
here is my original code
Code:
Private Sub Command4_Click()
'check to see if the data is entered into the Username Inbox
If IsNull(Me.Combo0) Or Me.Combo0 = "" Then
MsgBox "You Must enter your User Name.", vbOKOnly, "Required Data"
Me.Combo0.SetFocus
End If
'Check to see if data is entered into the password box
If IsNull(Me.Text2) Or Me.Text2 = "" Then
MsgBox "You must enter a Password", vbOKOnly, "Required Data"
Me.Text2.SetFocus
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.Text2.Value = DLookup("password", "TBL Logon", _
"[ID]=" & Me.Combo0.Value) Then
strlogon_name = Me.Combo0.Value
'close logon screen and open splash Screen
DoCmd.Close acForm, "FRM logon", acSaveNo
DoCmd.OpenForm "FRM Switch Board"
Else
MsgBox "Invalid Password. Please Try Again", vbOKOnly, "Invalid Entry"
Me.Text2.SetFocus
End If
End Sub