Using the DLookup function

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
 
B

Beetle

The correct syntax should be;

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

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