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

  • Thread starter Thread starter Martin
  • Start date Start date
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!!
 
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))
 
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))
 
Back
Top