Hi, all! I have a dialog box where the user inputs a username and password. Then I attach code to the OK Command Button (See Below). I also have a table with valid Usernames and passwords. Finally, I created a query that I pass the dialog box parameters to to check if the username and password is in the table. If it is, I want to open the main menu of the application so that the user can run the application. If the password and userid are not in the table, then a message box will open stating that they need to try again. I the error message 'Object Required'. Any ideas? Thanks a whole lot in advance!!
Private Sub OK_Click()
Dim stDocName As String
stDocName = "Qry_Login_PE"
DoCmd.OpenQuery stDocName, acViewNormal, acEdit
If Qry_Login_PE.PELastName.Value = Me.User_ID And Qry_Login_PE.Password.Value = Me.Pass_word Then
DoCmd.OpenForm FrmMainMenu, acNormal, , acEdit
Else
MsgBox "Incorrect UserID or Password, please try again"
End If
End Sub
Private Sub OK_Click()
Dim stDocName As String
stDocName = "Qry_Login_PE"
DoCmd.OpenQuery stDocName, acViewNormal, acEdit
If Qry_Login_PE.PELastName.Value = Me.User_ID And Qry_Login_PE.Password.Value = Me.Pass_word Then
DoCmd.OpenForm FrmMainMenu, acNormal, , acEdit
Else
MsgBox "Incorrect UserID or Password, please try again"
End If
End Sub