what is run-time error '2001' in MS Access?


G

Guest

I keep getting a run-time error '2001', but I can't find any information on
the nature of the error? The help button yields a blank screen...........
Any ideas?
 
Ad

Advertisements

D

Douglas J. Steele

If you go to the Immediate Window, type ?AccessError(2001) and hit Enter,
you'll get "You canceled the previous operation.@@@1@5738@1"

(If you were to display the Description property of the Err object when the
error occurred, that stuff at the end would be filled in with specific
information)
 
G

Guest

Any hints how to resolve '2001' problem, particularly when using DLOOKUP
within the basic code. I am using an event procedure to look up a table for a
value.
 
Ad

Advertisements

A

Allen Browne

When you receive this error, VBA is saying, "I couldn't do what you asked,
because I had to do something else first and that didn't work." It can be as
simple as needing to save the current record before being able to move
elsewhere.

In the context of DLookup(), the error means "I could not assign the return
value of the DLookup() because the attempt to lookup the value failed." That
happens if one of the 3 arguments is incorrect. For example, if you write:
MyVar = DLookup("MyField", "MyTable", "Field2 = 99")
but Field 2 is actually spelled with a space, you get this error. The
solution in this case is to correct the 3rd argument so it reads:
MyVar = DLookup("MyField", "MyTable", "[Field 2] = 99")

In short, you probably misspelled a field or table name, or referred to a
field that is not in the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top