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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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)
 
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.
 
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.
 
Back
Top