Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookUp in Text Box (Access 2003)

    I am trying to write an expression for a text box to return data from a table. I want to return the BranchHead corresponding to the "105-31" Branch in the table, tblDivision105-3. The following expression (and many variants of it) return a #Name? message...
    =DLookUp([tblDivision105-3].BranchHead,[tblDivision105-3],"[tblDivision105-3].Branch=105-31")

    I'd be very grateful for your help...

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

    Re: DLookUp in Text Box (Access 2003)

    All arguments to DLookup must be strings, and it looks as if the condition involves a string value too - such a value must be enclosed in quotes. So try
    <code>
    =DLookUp("BranchHead","[tblDivision105-3]","Branch='105-31'")
    </code>
    Since the condition argument is already enclosed in double quotes, I used single quotes around the value 105-31.

  3. #3
    New Lounger
    Join Date
    Apr 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookUp in Text Box (Access 2003)

    The single quotes did it, Hans - thanks! Whatever you're making (euros, guilders) in your real job; it ain't enough!!
    gratefully, Mark

Posting Permissions

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