Use an SQL statement as the row source for a list box or combo box on a form

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.

  1. Open a form in Design view.

  2. 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.

  3. Click the Build button next to the RowSource property to open the Query Builder.

  4. In the Query Builder, click SQL on the View menu.

  5. In the SQL window, select the entire SQL statement, and then press CTRL+C to copy it. Close the Query Builder.

  6. Click in the RowSource property box, and press CTRL+V to paste the SQL statement into the property box.

  7. Delete the original query in the Database window.

Notes