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

Discussion in 'Microsoft Access VBA Modules' started by Guest, Dec 8, 2004.

  1. Guest

    Guest 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?
     
    Guest, Dec 8, 2004
    #1
    1. Advertisements

  2. 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)
     
    Douglas J. Steele, Dec 8, 2004
    #2
    1. Advertisements

  3. Guest

    Guest 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.
     
    Guest, Dec 9, 2004
    #3
  4. Guest

    Allen Browne Guest

    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.
     
    Allen Browne, Dec 9, 2004
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.