Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Run Time Error 2001 (2000)

    I have a form from which I would like to copy some of the fields from the displayed record to a new record via VBA code executed on the OnClick event of a command button. The code hangs and I get the message: run-time error '2001': previous operation has been cancelled.

    The sub hangs on the following line of code for cmdCopyRecord_Click:

    AdoptFamilyNumber = DLookup("[FamilyNumber]", "Adopt", "[FamilyID] = TempID")

    Can anyone help me with this?
    Easy Access

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Time Error 2001 (2000)

    Use

    AdoptFamilyNumber = DLookup("[FamilyNumber]", "Adopt", "[FamilyID] =" & TempID)

    and similar for the other lines. Within the quotes, TempID is not known.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Run Time Error 2001 (2000)

    Hans,

    Once again I thank you for your quick response and expert knowledge. My form works like a charm.
    Easy Access

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •