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

Find Values in a Recordet

Status
Not open for further replies.

JasonSummers

Programmer
Sep 11, 2002
26
US
I have the following code in a form to create a recordset.

Dim rst As ADODB.Recordset, MyVal As Currency

Set rst = New ADODB.Recordset
rst.Open "SELECT TableName, MAX(UpdateDate) from stblTableUpdateLog GROUP BY TableName", CurrentProject.Connection

I have a table called tblTableUpdateLog that contains the fields
TableName
UpdateDate
UpdateBy

The table tracks when my tables are updated. Its a log.

My question is Using the recordset as defined above,

How to I iterate through it to find individual values? for example.

I want to find the Max date of each table listed. My recordset contains this inforamtaion, but I do not know how to iterate through it to grab it.

I have a form that should always display the information "Table X update on whatever date"

I just cant seem to figure out how to iterate through each row that my select and group query provides in the recordset.

THank you,
j
 
Take a look at

Do Until ..... Loop

Do While ..... Loop

checkig for rst.EOF When there are no more records, that value is true.
rst.BOF denotes that you went, before the first record.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top