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

for next question

Status
Not open for further replies.

rmh3619

Technical User
May 29, 2006
29
NL
I have a table called "customer" with a field "customer_name"

i want to execute code for each customer_name in the table. (e.g. msgbox customer_name)

how can i do this. i think i should use a for / next statement but I dont know how.

Thanks
 
What kind of code do you want to run? What I'm reading is you want a message box to come up for each customer?

John Green
 
Assuming you actually want to do something and not display a message box each time, there are a number of ways to do it.

If you want to update values in one or more columns in an associated table you could create an update query (or even more than one update query). There are a lot of things you can do in queries, even some fairly complex things, so that's probably the best way to go.

If you want to perform a lot of operations for each customer, then you probably need to create a recordset of the customers and loop through the recordset so you get all of the customer numbers. For each customer execute all the code you want.

Bob
 
I think you need to be a lot clearer on what you're trying to accomplish if you want us to help.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top