I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?
Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"
Add a Command Button to the form.
Code the button's click event:
Me.Visible = False
Name this form 'ParamForm'.
In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity
Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog
Code the report's Close event:
DoCmd.Close acForm, "ParamForm"
When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.