HELP - DLookUp (should be easy but I'm stuck)

M

Martin

I'm trying in a form to have some fields updated
automaticaly using a DLookup:

DLookUp("[TA000 - Customer]![Account
Name]","[TA000]","[Account]=Forms![F015 - Deals]!
[Account]")

[TA000] is my reference table where I have the Account and
account names fields.
[F015 - Deals] is the form used to update table [TA001]
where are located the fields Account and account name that
needs to be updated.

On the form I want the Account name to show up when I
select an account number. Even excel can do this but for
some reason I've been stuck all day on this.

very grateful for any tip/help you can provide. I'm also
flexible on the mean to update the form. Doesn't have to
be with VLookup.

Thanks!!
 
D

Douglas J. Steele

Is Account numeric or text?

If numeric, try

DLookUp("[TA000 - Customer]![Account Name]","[TA000]","[Account]=" &
Forms![F015 - Deals]![Account])

If text,

DLookUp("[TA000 - Customer]![Account Name]","[TA000]","[Account]='" &
Forms![F015 - Deals]![Account] & "'")

or

DLookUp("[TA000 - Customer]![Account Name]","[TA000]","[Account]=" &
Chr$(34) & Forms![F015 - Deals]![Account] & Chr$(34))
 
G

Guest

Thanks Doug,
The account field is a text field. Unfortunately it still
doesn't work. :-(
 
D

Douglas J. Steele

I should have read more closely. The [TA000 - Customer]! is wrong.

DLookUp("[Account Name]","[TA000]","[Account]='" &
Forms![F015 - Deals]![Account] & "'")

or

DLookUp("[Account Name]","[TA000]","[Account]=" &
Chr$(34) & Forms![F015 - Deals]![Account] & Chr$(34))
 

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

Ask a Question

Top