Critria Mismatch

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

This Dlookup is giving me a criteria mismatch.
Is the syntax wrong.
Thanks
DS

Me.TxtIssueDate = DLookup("GiftDate", "tblGiftCards", "GiftCardNumber = " &
Forms!frmFXGiftManager!TxtGiftID)
 
If GiftID is text data type, change the criteria to:

"GiftCardNumber = """ & Forms!frmFXGiftManager!TxtGiftID& """")

I always put square brackets around a table field when using DLookup or
other aggregate lookukp functions
"[GiftDate]"

If txtIssueDate and txtGiftID are both on the same form you can use

Me.TxtIssueDate = DLookup("[GiftDate]", "tblGiftCards", "GiftCardNumber =
""" & Me.TxtGiftID& """")

Jeanette Cunningham
 
Back
Top