Use an SQL statement as the row source for a list box or combo box on a form
You might want to use an SQL statement instead of a saved query for the row source of a list box or combo box on a form so that the query doesn't show up in the Database window. However, list boxes and combo boxes based on SQL statements are slower than list boxes and combo boxes based on saved queries.
- Open a form in Design view.
- Make sure the list box or combo box is selected, and then click Properties on the toolbar to open the property sheet for the control.
- Click the Build button next to the RowSource property to open the Query Builder.
- In the Query Builder, click SQL on the View menu.
- In the SQL window, select the entire SQL statement, and then press CTRL+C to copy it. Close the Query Builder.
- Click in the RowSource property box, and press CTRL+V to paste the SQL statement into the property box.
- Delete the original query in the Database window.
Notes
- For information on properties that you can use to customize a list box or combo box, click .
- If you create a list box or combo box on a form with a wizard, Microsoft Access uses an SQL statement as the row source for the list box or combo box.