Results 1 to 2 of 2
  1. #1
    Vodi's Avatar
    Vodi is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    10

    Question Run-time error '2501': The OpenForm action was canceled (Access 2010)

    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.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you are positive nothing has changed since the last successful login, only thing I can imagine is form corruption.

    Probably should open frmPasswordChange in acDialog mode so the code execution will suspend until the form closes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-11-2014, 09:41 AM
  2. runtime error 2501 openform action was canceled
    By rumenrs in forum Programming
    Replies: 2
    Last Post: 04-11-2013, 04:29 AM
  3. Replies: 6
    Last Post: 11-28-2012, 03:43 PM
  4. Replies: 15
    Last Post: 07-26-2012, 02:06 PM
  5. Replies: 7
    Last Post: 07-18-2012, 07:53 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums