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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset method for a form

Status
Not open for further replies.

asif79

Programmer
Oct 18, 2002
12
US
Hi All
I am trying to create a form based on a query and I am trying to connect it using the recorset method. I am able to connect the form but it does not allow me to navigate the records. It just shows the first record. Any help in his matter will be highly appreciated.

Asif
 
Asif,

Your problem as stated leaves me wanting more information. If you have created a query (saved a query), it can be connected to the form's Record Source property in the properties window. If you do that, no other connecting is required.

If your query is being created in code by opening a recordset, you can still connect the recordset to the form's RecordSource in code.

If the code is run from one of the form's events, use

Me.RecordSource = RecordsetName

If in the code of a module or another form's events, use:

Forms![FormName].RecordSource = RecordsetName
 
Hi
Actually my query is saved but I am still not sure how to connect it through the property window.

Asif
 
Asif,

It's easy. Access treats a query as a Record Source the same way it treats a table as a Record Source. Its just a group of records.

Open your form in Design View. Open the properties window. Click in the Record Source field. There will be a drop down list of all the tables and all the saved queries. Just pick the one you want from the list.
 
Hi... and thanks for all the help

Asif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top