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!

Just starting - manipulating Access data using VBA 1

Status
Not open for further replies.

cdipaolo

Programmer
May 1, 2002
36
US
I have a few complex queries created in Access but now I have to use some VBA logic to step through the records in these queries and sort/exclude some of them. Do I just start up a module and use the same ADODB type stuff as I would if I did it in Excel? Or is there an easier way to approach it since I'm already in the Access DB?

Example - I am getting a list of users that meet criteria, now I need to go through this list of users one by one and see if they have met certain education requirements, depending on what type of user they are.
 
Do I just start up a module and use the same ADODB type stuff as I would if I did it in Excel? Yep!

Something like this:

Code:
Dim rs as New ADODB.Recordset

rs.Open "YourQueryName", CurrentProject.Connection

Do While Not rs.EOF
  ' Your Logic here
  rs.MoveNext
Loop

Set rs = Nothing


I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top