Link to home
Start Free TrialLog in
Avatar of robinski
robinski

asked on

Runtime Error 2001


I have made some changes to a database that has been running for five years. It includes a combo box to find member's entries.

I have given myself the error message:

"" Runtime error 2001
   You cancelled the previous operation ""

I have not made changes to the combobox so I am perlexed as to where I should look for my error.

Code is below.

Thanks,

Robin


Private Sub MemberList_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Naim] = '" & Me![MemberList] & "'"

    'This next line is selected on error 2001

    Me.Bookmark = rs.Bookmark
    DoCmd.GoToControl "Surname"
   
End Sub
Avatar of TextReport
TextReport
Flag of United Kingdom of Great Britain and Northern Ireland image

Check to see if the record have change before you move the record with the bookmark. You can check if Me.Dirty = True. If so the save record which is automattically triggered when you move to another record could be failing. If you set me.dirty = false it will force the save record.

Cheers, Andrew
Avatar of robinski
robinski

ASKER

Thanks Andrew,

This error happens without any changes to data.

For instance, open application, select John Smith, John Smith record appears. Then select Fred Brown error message appears.

I am still a beginner and i do not understand where to put me.dirty

Thanks,

Robin
Hi Robin,

I suspect something is wrong with the .mdb itself.
Did you try a compact/repair and/or a decompile?
(http://www.granite.ab.ca/access/decompile.htm)
Or the jetcomp: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q273956

If that doesn't help, drop the .mdb in my mail and I'll have a look.

Nic;o)
Robin, turn on the record selector of you form so that when you run the MemberList_AfterUpdate you can see if the recordselector has an arrow head or a pencil, if it is a pencil then something is changing the data in the current form, could MemberList be bound to a field?

Cheers, Andrew
Andrew,

MemberList is unbound. I am a real amateur. How do I turn on the record selector?

Thanks,

Robin
ASKER CERTIFIED SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the five star service.