Results 1 to 2 of 2

Thread: DLookup

  1. #1
    Join Date
    Sep 2001
    Posts
    175

    Question Unanswered: DLookup

    I am using the DLookup function to return the value of a field a TableX but when the value is returned it is updating the field with the same value for all records. eg

    vary = Me!invoice_no (invoice no. on the form)
    invamt = DLookup("[inv_amt]", "agtospayment", "[invoice_no] = " & vary)

    Text23 = invamt

    All the records have the same value in Text23.

    Can someone tell me what I am doing wrong????

  2. #2
    Join Date
    Dec 2001
    Posts
    79
    You'll need to put that code in your form OnCurrent event procedure. Did you do this?

    A better way would be to create a join query that joins your form data with the invoice amount. Then use this query as your form recordsource. When you do this, the invoice amount is automatically looked up and Dlookup is not needed.

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

Posting Permissions

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