Results 1 to 3 of 3
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Runtime Error 2501 - The Close action was cancelled.

    My well tested and used application has sprung a new leak. One particular form which has been used thousands of times will not close. We I click any button that causes the form to close I get runtime error 2501 hanging up on this line of code.


    Code:
    DoCmd.Close acForm, Me.Name
    When I try to close the form manually I get the same error. Even when I do an End Task in Task Manager the same thing happens until I force the program to close. Several other forms work normally. I even had this for working momentarily till it went back to it's original behavior.

    Any suggestions on what to do?

  2. #2
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    Not a real solution, but try to import the database into a new file to see if it works. My command buttons sometimes go haywire and importing it into a new file fixes them, maybe it's the same kind of thing.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    It turns out the problem was less mysterious than originally presented. I traced more carefully what code was being executed and found that my form unload code was looping back on itself due to a change I recently made. When the form tried to close itself again after the unload code was already running it got confused and spat out runtime error 2501. I broke the chain and solved the problem.

    Thanks for letting me think outload. As often as not, that's all it takes.

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

Similar Threads

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

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