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

Set a variable equal to data from table

Status
Not open for further replies.

medic133

Technical User
Apr 7, 2002
86
US
I have successfully opened a record set from a table (I think)containing five records. I want to use VBA to set a unique variable equal to each of the five records, and then perform calculations on these variables (such as add two of the variables together, then three, etc.). How do I go about setting these variables equal to the values returned in the record set?
 
Hi

Say you recordset object is Rs, the you address each column with:

Rs!ColumnName

or

Rs("ColumnName")

You move through the record set from Row to row using a construct like

Do Until rs.EOF
Rs.MoveNext
Loop

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top