From: Andrew Thorpe on
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
From: Beetle on
The correct syntax should be;

DLookup("HolDate", "HOLIDAY", "HolDate =#" & Me.StartDate & "#")
--
_________

Sean Bailey


"Andrew Thorpe" wrote:

> 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