Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i display the results of a query on a form ??

Status
Not open for further replies.
Feb 12, 2001
52
GB
Hi,

IS it possible to display the results of query on to a form ? I thought of using a list box, but whilst using the wizard it does like the query that i'm trying to use, so i can't finish setting up the list box.

Cheers in advance,

Chris
 
You can set a form's Record Source property to the query. Then any controls you use on the form will display the query results.

If you want to display it on an existing form with either a blank or a different Record Source, you can display it in a subform instead. First create a form to display the query (set Record Source to the query name). Set up any controls you need, and specify Default View as either Continuous Forms or Datasheet, depending on how you want it to look. Save that form, and then drag it from the database window to a blank area in your existing form. That will create a subform control that displays the query results form.

If your main form has a Record Source and you want the query results to be restricted to records that go with the one the main form is showing, set the subform control's Link Master and Link Child fields to the common field(s) shared by the main form and subform's underlying recordsets, respectively. Otherwise just clear these properties, and the subform will display all records in its recordset. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top