4. Select a query from the form before the method, although simple, but for the user is not easy to operate, the designer is also difficult to control, if the form to implement, these problems can be solved. As in the following form, the runtime user can select the driver's name in the combo box and press the query button to see the results of the query.
The following is a detailed list of the steps for the design:
Create a form, press the Control Wizard button, and add a combo box to the form. In the first dialog box
Select "I want the combo box to find these values in a table or query," next.
Select a table or query that provides data for the combo box. Next.
Select the data you want to display in the combo box, usually selecting the primary key for the table in addition to the fields that you want to appear in the combo box. Next.
If the primary key is an AutoNumber field, usually select Hide primary key column, and next, give the combo box a name and finish.
To build a query, enter the field name of the form combo box in the criteria for the field of the query, enter "[forms]! [Conditional query]! [Driver to inquire] '. For convenience, you can use an Expression Builder to generate this expression. Save this query as "Search by driver name".
Then go back to the form and add a button. Select Miscellaneous/Run queries in the first dialog box of the Control Wizard. Next.
Select the newly built query "by driver name query", next.
Enter the text displayed on the button, or use a picture to indicate the button. Next, give the button a name and finish.
0 run this form, as shown in the top image on this page, select "Horse Jack" in the combo box and press the "query" button to see the results of the query