Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error '2001', You canceled the previous operation.

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
When i select and change the combobox, i get an error.
Run-time error '2001':
You canceled the previous operation.
But the strange part of it is that I only get it if i run the code in one.
If I put a break point in the code, and step through, I wont get the error, and the code does what it is supposed to do.
the debugger tells me that the error is on th line with:
Me.Bookmark = rs.Bookmark



Private Sub Combo11_AfterUpdate()
On Error Resume Next
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
On Error GoTo 0
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ReportID] = " & str(Me![Combo11])
Me.Bookmark = rs.Bookmark
DoEvents
ReportID.Visible = True
DoEvents
Report_Name.Enabled = True
Report_Name.SetFocus
Combo11.Visible = False
HideAll
End Sub

Sub HideAll()
tabstopper.SetFocus
lbl_reporttype.Visible = False
cmb_reptype.Visible = False
cmd_next.Visible = False
cmb_Person.Visible = False
lbl_Person.Visible = False
cmb_group.Visible = False
lbl_group.Visible = False
End Sub
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
it may be with your Line On Error Go To 0. just a couple of debugging suggestions since you don't get the error when you walk through. Comment Out the 2 DoEvents and the On Error Go To 0, then run your program again. if you don't get the erro uncomment one of the commented statements untill you get the error. But I don't see anything wrong but that error statement.

HTH

 
Nope, no luck. well ok, i don't get the error code, but that is because of the first "On error resume next" but then the function does not do what it is supposed to do....

I tried to skip the first part, so I changed the code to look like this, but i get the same error.

Private Sub Combo11_AfterUpdate()
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ReportID] = " & str(Me![Combo11])
Me.Bookmark = rs.Bookmark
DoEvents
ReportID.Visible = True
DoEvents
Report_Name.Enabled = True
Report_Name.SetFocus
Combo11.Visible = False
HideAll
End Sub

Sub HideAll()
tabstopper.SetFocus
lbl_reporttype.Visible = False
cmb_reptype.Visible = False
cmd_next.Visible = False
cmb_Person.Visible = False
lbl_Person.Visible = False
cmb_group.Visible = False
lbl_group.Visible = False
End Sub
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
On your References do you have DOA 3.X Library checked? and is it befreo the Active X Object library?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top