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

Just a quick one

Status
Not open for further replies.
Jun 20, 2003
40
GB
Not sure if I'm being stupid or not but here goes.

I have a query that holds a number of records, I want to hold the first record in a variable so that I can populate a form with the data. What's the best way of doing this?
 
What I would do is bind the form to the query then you will have the data in the form, and can scroll through the data.
However, you may not be able to edit the data or add new records with this form if the query uses aggregate functions, Union or other calculated values.

John
 
Thanks for the reply John, however I'm only after the first record in the query. The data from the form is held in another table.

So I basicly need to passwd the results of a query in the a VBA object.
 
You can use a recordset object or DLookup in code to obtain the primary key value of the first record and pass this over to the form, then this can be used to obtain all the other data with DLookups or recordset objects.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top