Guest_imported
New member
- Jan 1, 1970
- 0
I have a query and I'm able to run it once, but when I try and run it again i get the error: Run-Time error '2001': "You canceled the previous operation" What does this mean? I posted the code that its giving me the error on. It's a command button known as cmdSrch. The debug is pointing at the line that reads
--> docmd.openQuery "or query"
rem Code below...
If ((Opt1.Value = 0) And (Opt2.Value = 0)) Or Check83.Value = False Then
MsgBox "Please select an option AND enter at least one criteria"
End If
Rem Check to see which query to run
If Opt1.Value <> 0 Then
DoCmd.OpenQuery "and query"
Else
DoCmd.OpenQuery "or query"
End If
REM Reset Values
Check83.Value = False: Check76.Value = False: Check74.Value = False: Check72.Value = False
Check70.Value = False: Check68.Value = False: Check66.Value = False: Check64.Value = False
Text1.Value = "": Text2.Value = "": Text3.Value = "": Text4.Value = "":
Text5.Value = "": Text6.Value = "": Text7.Value = "": Text8.Value = ""
Text1.Visible = False: Text2.Visible = False: Text3.Visible = False: Text4.Visible = False:
Text5.Visible = False: Text6.Visible = False: Text7.Visible = False: Text8.Visible = False
End Sub
--> docmd.openQuery "or query"
rem Code below...
If ((Opt1.Value = 0) And (Opt2.Value = 0)) Or Check83.Value = False Then
MsgBox "Please select an option AND enter at least one criteria"
End If
Rem Check to see which query to run
If Opt1.Value <> 0 Then
DoCmd.OpenQuery "and query"
Else
DoCmd.OpenQuery "or query"
End If
REM Reset Values
Check83.Value = False: Check76.Value = False: Check74.Value = False: Check72.Value = False
Check70.Value = False: Check68.Value = False: Check66.Value = False: Check64.Value = False
Text1.Value = "": Text2.Value = "": Text3.Value = "": Text4.Value = "":
Text5.Value = "": Text6.Value = "": Text7.Value = "": Text8.Value = ""
Text1.Visible = False: Text2.Visible = False: Text3.Visible = False: Text4.Visible = False:
Text5.Visible = False: Text6.Visible = False: Text7.Visible = False: Text8.Visible = False
End Sub