You probably want to filter your report by year also!
Presumably you have these two tables:
TblCity
CityID
City
TblSite
SiteID
Site
Your form, named ReportCriteria, needs four comboboxes. The first, cboCity,
has a rowsource of TblCity. The second has a rowsource of TblSite. The
third, cboYear, has a rowsource of a query that returns a list of the Years
in your TblPayroll. The fourth, cboMonth, has a value list fom 1 to 12.
You need a query that contains the fields, CityID, SiteID, Year([PayDate])
and Month([PayDate]).
The criteria for CityID needs to be:
Forms!ReportCriteria!cboCity
The criteria for SiteID needs to be:
Forms!ReportCriteria!cboSite
The criteria for Year([PayDate]) needs to be:
Forms!ReportCriteria!cboYear
The criteria for Month([PayDate]) needs to be:
Forms!ReportCriteria!cboMonth
Set the recordsource of your report to this query.
Finally, you need a button on ReportCriteria that opens your Report. You
need code in the click event of he button that first checks to see if all
comboboxes have a value and then if they do, opens the report.
Steve
(e-mail address removed)