Access recordSource from Form's VB Code

eellenoff

Registered User.
Local time
Today, 15:13
Joined
Jul 17, 2007
Messages
17
Hello,

I have a form with the recordSource set to a query that would give me a set of contact information. What I would like to be able to do is to iterate through that query, and access the attributes of each tupple. Do I somehow have access to the data contained in the query by nature of it being the recordSource? If so, what is the syntax for accessing that data? If not, can anyone provide some skeleton code as to how I should connect back to the database to get the query data I need?

Thanks!
-Eric

Access 2003, VB6
 
Design a form where the record source is the query. You can then add two command buttons to move through the record source (next and previous).
 
or use a recordset

Code:
set rst=currentdb.openrecordset(myquery)
while not rst.eof
'read fields in this tuple with
 rst!fieldname syntax

'goto nerxt record with
 rst.movenext
wend
 
and as FYI- in Access 2000 and later, you can manage form's recordset instead of recordsource and do something with it, if so desired.
 

Users who are viewing this thread

Back
Top Bottom