"run-time error 2001 You canceled the previous operation."

Posted on 2006-04-27
Last Modified: 2010-08-05
I have this piece of code in five forms, just the queries are different and One form I get this error.  "run-time error 2001 You canceled the previous operation."

When it hits this line in the code
 DoCmd.RunMacro "Macro 4-5 Find PairOutBefore"

Any suggestions would greatly be appreciated.  

I have researched and the answers had to do with lookup function which has nothing to do with this piece of code.

This macro is just refresh and append queries.


 iResponse = MsgBox("Are You Sure?", vbOKCancel, "Processing")
 Select Case iResponse
   Case vbOK
     If Me.Dirty = True Then _
       Me.Dirty = False 'DoCmdRequery
        DoCmd.RunMacro "Macro 3-2 MakeTradeLimitRoll Table_TradeLimitPairoutTable"
        DoCmd.RunMacro "Macro 4-5 Find PairOutBefore"
        DoCmd.RunMacro "MacroDeleteBlankRecordsForPairOuts"
    Case vbCancel
        Exit Sub
   End Select
Question by:ca1358
    LVL 19

    Accepted Solution

    try this
    DoCmd.RunMacro "Macro 3-2 MakeTradeLimitRoll Table_TradeLimitPairoutTable"
    doevents  '<-Change there
    DoCmd.RunMacro "Macro 4-5 Find PairOutBefore"
    doevents  '<-Change there

            DoCmd.RunMacro "MacroDeleteBlankRecordsForPairOuts"
    doevents  '<-Change there

            Forms![frmMaintenance]![frmPairOut].form.Requery    '<-Change there

    Author Comment

    Thank you!
    LVL 19

    Expert Comment

    You welcome

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now