"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
ca1358Asked:
Who is Participating?
 
dmitryz6Connect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.