View Full Version : Query criteria return no records


josi3006
11-05-2008, 01:42 PM
How can I prevent a query from running if the query criteria return no records? I'm running a parameter query that asks for month and date. If the user chooses a date that doesn't exist (June 31, for example), the query returns a blank record. I don't want the user to be able to create a new record in this case, so I'd rather the query not return anything when no current records exist.

namliam
11-05-2008, 11:34 PM
You cannot.

2 ways of doing this..
1) Use a form or report
2) Get the month and date before running the query, then check to make sure there is data there and actually run the query.

Running a report would allow you to use the "if no data" part of the report to give a message and close. That would be most simple IMHO.
Also it 'blocks' the user from any data entry possibilities.