DLookup Syntax

  • Thread starter Maverick6197 via AccessMonster.com
  • Start date
M

Maverick6197 via AccessMonster.com

What's wrong with this syntax.....

E-MAIL CONTACT: DLookUp("[DEALER #]","tblMasterDealerContact","[AUTAC LOOKUP
CODE]= ([DEALER NUMBER] & "SRVM")")

"DEALER #" and "AUTAC LOOKUP CODE" are fields in the table
"tblMasterDealerContact".

Thanks for any help in advance.....

Shannan
 
D

Dennis

I am assuming [DEALER NUMBER] is a variable numeric value with the Text SRVM
appended to it
For example, get me the [Dealer #] field from the tblMasterDealerContact
table Where the [AUTAC LOOKUP CODE] is 36SRVM

If I have assumed correctly then you need this (be aware of the apostrophes)

E-MAIL CONTACT: DLookUp("[DEALER #]","tblMasterDealerContact","[AUTAC LOOKUP
CODE] = '" & [DEALER NUMBER] & "SRVM'")
 
M

Maverick6197 via AccessMonster.com

Dennis,

Thank you for your help. I think I had a brain lapse........Here is the code
that I got to work. I wasn't meaning to pull the "DEALER #" field. I don't
know what I was thinking.....

E-MAIL CONTACT: DLookUp("[E-MAIL CONTACT]","tblMasterDealerContact","[AUTAC
LOOKUP CODE]='" & [DEALER NUMBER] & "SRVM'")


Shannan
I am assuming [DEALER NUMBER] is a variable numeric value with the Text SRVM
appended to it
For example, get me the [Dealer #] field from the tblMasterDealerContact
table Where the [AUTAC LOOKUP CODE] is 36SRVM

If I have assumed correctly then you need this (be aware of the apostrophes)

E-MAIL CONTACT: DLookUp("[DEALER #]","tblMasterDealerContact","[AUTAC LOOKUP
CODE] = '" & [DEALER NUMBER] & "SRVM'")
What's wrong with this syntax.....
[quoted text clipped - 7 lines]
 
Top