DLookup will only return a Null

  • Thread starter gchichester via AccessMonster.com
  • Start date
G

gchichester via AccessMonster.com

Can anyone see why this DLookup will only return a Null?
I have verified that all data types are set to Text, and
the lookup table has the correct data.

? Forms![frmAsiaNotice]! [AsiaNoticeShipLine]
FE NYK Lines

? Forms![frmAsiaNotice]! [cboAsiaNoticeServiceContractCustomer]
SUMIFRU CORPORATION

? DLookup("[ContractNumber]", "AsiaContract", " [ContractShipLine] = '" &
Forms![frmAsiaNotice]![cboAsiaNoticeShipLine] & " And [Contract]!
[ContractCustomer] = " _
& Forms![frmAsiaNotice]![cboAsiaNoticeServiceContractCustomer] & "'")
Null
 
K

Ken Snell

You're missing some ' characters:

DLookup("[ContractNumber]", "AsiaContract", " [ContractShipLine] = '" &
Forms![frmAsiaNotice]![cboAsiaNoticeShipLine] & "' And [Contract]!
[ContractCustomer] = '" _
& Forms![frmAsiaNotice]![cboAsiaNoticeServiceContractCustomer] & "'")
 
G

gchichester via AccessMonster.com

Ken,
Thanks, for the fast responds, DLookup is working as expected.

Ken said:
You're missing some ' characters:

DLookup("[ContractNumber]", "AsiaContract", " [ContractShipLine] = '" &
Forms![frmAsiaNotice]![cboAsiaNoticeShipLine] & "' And [Contract]!
[ContractCustomer] = '" _
& Forms![frmAsiaNotice]![cboAsiaNoticeServiceContractCustomer] & "'")
Can anyone see why this DLookup will only return a Null?
I have verified that all data types are set to Text, and
[quoted text clipped - 11 lines]
& Forms![frmAsiaNotice]![cboAsiaNoticeServiceContractCustomer] & "'")
Null
 

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