Have a command button on a menu to launch a report rptHours based on a simple query qryHours that uses [Enter Start Date] and [Enter End Date] parameters to define a date range, as below.
PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
SELECT tblCoordinatorHours.Hours, tblCoordinatorHours.ActivityType, tblCoordinatorHours.HoursDate, qryExplorers.Name
FROM (qryCoordinators INNER JOIN (qryExplorers INNER JOIN tblCoordinatorHours ON qryExplorers.Name = tblCoordinatorHours.ExplorerName) ON qryCoordinators.StaffID = tblCoordinatorHours.StaffID) INNER JOIN tblHomeTypes ON qryExplorers.HomeType = tblHomeTypes.HomeType
WHERE (((tblCoordinatorHours.HoursDate) Between [Enter Start Date] And [Enter End Date]));
I'd like to check that that there are records in the selected date range and avoid running the report if not, otherwise it shows #Errors everywhere. Instead I'd put up a message 'No data in selected date range".
If it weren't a parameter query I could use DCount as the check. How do I do it with this query?
PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
SELECT tblCoordinatorHours.Hours, tblCoordinatorHours.ActivityType, tblCoordinatorHours.HoursDate, qryExplorers.Name
FROM (qryCoordinators INNER JOIN (qryExplorers INNER JOIN tblCoordinatorHours ON qryExplorers.Name = tblCoordinatorHours.ExplorerName) ON qryCoordinators.StaffID = tblCoordinatorHours.StaffID) INNER JOIN tblHomeTypes ON qryExplorers.HomeType = tblHomeTypes.HomeType
WHERE (((tblCoordinatorHours.HoursDate) Between [Enter Start Date] And [Enter End Date]));
I'd like to check that that there are records in the selected date range and avoid running the report if not, otherwise it shows #Errors everywhere. Instead I'd put up a message 'No data in selected date range".
If it weren't a parameter query I could use DCount as the check. How do I do it with this query?