Populating Query Results in a Form Control
If you want to display your query results in a form, you can use a table, array, or cursor to populate a grid, list box, or combo box.
To populate a list box or combo box control with a table or cursor
- In the Form Designer, modify the form that has the control you want to populate.
- Set the RowSourceType property to 3 - SQL Statement.
- In the control's RowSource property, enter a SELECT - SQL statement that includes an INTO TABLE or INTO CURSOR clause.
To populate a grid control with a table or cursor
- In the Form Designer, modify the form that has the control you want to populate.
- In the form's Load event, enter a SELECT - SQL statement that includes an INTO TABLE or INTO CURSOR clause.
- Set the grid's RecordSource property to the name of the table or cursor you created in Step 2.
- Set the grid's RecordSourceType property to 0 – Table (for a table) or 1 – Alias (for a cursor).
See Also
Storing Query Results in a Table, Array, or Cursor | Printing Query Results in a Report or Label | Displaying Query Results in a Window