Using the DLookup function

  • Thread starter Thread starter Andrew Thorpe
  • Start date Start date
A

Andrew Thorpe

I have a table that includes a field StartDate. Another table (HOLIDAY) holds
dates announced as Holidays. I am trying to use the Lookup function to see if
my StartDate matches a HolidayDate. I have tried
If Forms!frmAssignment!StartDate = DLookup("HolDate", "HOLIDAY", "HolDate =
" & Me.StartDate) Then.........
Unfortunately, it doesn't run!! (The datatypes throughout are ShortDate).
I've tried the same using the # sign as part of the last section, but still
no joy. Would appreciate any help. Thank you. Andrew
 
The correct syntax should be;

DLookup("HolDate", "HOLIDAY", "HolDate =#" & Me.StartDate & "#")
 
Back
Top