• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1168
  • Last Modified:

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

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"
        Forms![frmMaintenance]![frmPairOut].Requery
     
     
    Case vbCancel
   
        Exit Sub
   End Select
0
ca1358
Asked:
ca1358
  • 2
1 Solution
 
dmitryz6Commented:
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
0
 
ca1358Author Commented:
Thank you!
0
 
dmitryz6Commented:
You welcome
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now