What I would like is to modify my code that depending on the type of user, a different frm will pop up.
Either frmMainMenuAdmin >>>>>tied to admin (type)
frmMainMenuUser >>>>>tied to user (type)
frmMainMenuManager >>>>>tied to manager (type)
I cannot seem to get this to work correctly. Can someone please help?
---------------------------------------------------------------------------------------------------------------------------
Here is my code for the login:
Private Sub cmdLogin_Click()Dim dbs As DatabaseDim rstUserPwd As RecordsetDim bFoundMatch As BooleanSet dbs = CurrentDbSet rstUserPwd = dbs.OpenRecordset("qryUserPwd")bFoundMatch = FalseIf rstUserPwd.RecordCount > 0 Then rstUserPwd.MoveFirst ' Check for matching records Do While rstUserPwd.EOF = False If rstUserPwd![UserName] = Form_frmLogin.txtUserName.Value And rstUserPwd![Password] = Form_frmLogin.txtPassword.Value Then bFoundMatch = True Exit Do End If rstUserPwd.MoveNext LoopEnd IfIf bFoundMatch = True Then' Open the next form here and close this oneDoCmd.Close acForm, Me.NameDoCmd.OpenForm "frmMainMenuAdmin"'Change this to the switchboard form name'Else MsgBox "Incorrect Username or Password"End IfrstUserPwd.CloseEnd Sub