I've looked through other related threads and can't find anything that works for my issue. I'm also an amateur in Access.
Here's how this database in Access 2010 works: A user opens the database and is greeted by a login form (frmLogin). They select their credentials from the dropdown list (cboUser) and type their password into the text box (txtPassword) and press Enter. frmLogin minimizes and frmMainMenu opens and takes the helm. frmMainMenu takes the user's credentials from frmLogin and displays their name on frmMainMenu. Each user is also assigned an access level to determine what forms/subforms they can edit. From frmMainMenu, the user can view various reports or open a form to input data.
The problem that I'm having is this Run-time error '2501'. It suddenly came up today and prevents users from logging in. I haven't changed anything in weeks and users can only input data through a form. Does anyone have any insight as to what may be causing this? Below is the code that comes up in the debugger (DoCmd.OpenForm "frmMainMenu" is highlighted yellow in the debugger):
Code:
Private Sub txtPassword_AfterUpdate()
If IsNull(Me.cboUser) Then
MsgBox "Please select a User", vbCritical
Me.cboUser.SetFocus
Else
If Me.txtPassword = Me.cboUser.Column(2) Then
If Me.cboUser.Column(3) Then
DoCmd.OpenForm "frmPasswordChange", , , "[UserID] = " & Me.cboUser
End If
DoCmd.OpenForm "frmMainMenu"
Me.Visible = False
Else
MsgBox "Password does not match. Please re-enter your password", vbOKOnly + vbExclamation
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
End If
End Sub
Your time and assistance are much appreciated.