I created a Form, a Query and a Report in MS Access 2010. How do I tight these 3 components together, so when a button is clicked on the Form, the Report will show up and displaying the records according the fields in the Form.
the form has 3 text fields and a command button.
3 text fields: passing Date, ModelName, Color parameters.
1 command button: when button is clicked, the report will show up and displaying the records according to the fields in the 3 text fields.
a Query statement showing all records regarding the 3 parameters that are passed from the form.
this query's WHERE clause refers to the Form and the 3 parameters.
When click Run, this query is running fine by itself and displaying records.
a report is made and set the control source to the name of the above query.
The command button of the Form has an onClick event tight to a Macro with an Action of "SetValue": item = [visible] expression = no
The Report will display records without problems if I do the following:
1. Enter the values of the 3 parameters on the Form.
2. Click the command button. -> then this Form goes away.
3. Navigate to Queries in MS Access. Click on the Query -> then records shows in grid view.
4. Navigate to Reports in MS Access. Click on the Report -> the records of the Query show in the Report.
How do I tight together the command button on the Form, the Query, and the Report together, so when I click on the command button on the form , the Report will open and display the records according to the 3 text fields on the Form?