View Full Version : Help required for query


gear
09-13-2007, 08:36 PM
I need to see the records of a specific date very often. I have designed a simple query (Field : My date field; Criteria : Enter the Date) and it is giving info I want. However, sometimes it shows no records making me wonder where all the data had vanished. On checking up further, I discover that the date I specified was a Sunday, a holiday, when no data entry takes place. What I now want is that if the query returns no records, it should also give a message that "the date you specified could be a holiday. please check" so that I would not panic. Is it possible?
Alternatively, the query can look up the day of the specified date and return the message. I shall be grateful for help for any of these query designs.

Uncle Gizmo
09-14-2007, 12:55 AM
Create a function that runs your query string; the text version of it. Adapt it to do a record count, and if the record count is zero then display the message you want. If the record count is not zero then run the query from your code.

gear
09-14-2007, 06:21 AM
Thanks for the advice. But I don't know much about VBA/SQL programming. Grateful if you explain how to do it. Thanks in advance.