dlookup for public holiday check in query expression

stevekos07

Registered User.
Local time
Today, 00:08
Joined
Jul 26, 2015
Messages
174
Hello. I have a query with a field that checks against a range of criteria in order to resolve to a "Yes" or "No" for any given date. I wish to add a dlookup function to the expression which looks up today's date against a table of public holiday dates. The expression I am using is:

iif(([P/H]=True And DLookUp("HolDate","tblPublicHolidays","HolDate=Date()"),"No","Yes"))

[P/H] is a Yes/No field in tblPublicHolidays. I added today's date in the table to test the expression on today's date but unfortunately, while the query seems to run without any errors, the result is unchanged regardless whether the [P/H] field is checked or unchecked .

Thanks for any help.
 
Last edited:
Oops. I forgot that my form was based on the table with a calculated field rather than on the query. It works with the above syntax. Thanks anyway :).
 

Users who are viewing this thread

Back
Top Bottom