making a query loop

scott80180

New member
Local time
Today, 23:45
Joined
Feb 12, 2003
Messages
5
I have two tables one with store info and one with customer info. I am trying to query the customers that are linked to the store table but i want the query to loop through the store codes and make a table or a report for each store code. Not sure if this can be done, any help will be appreciated.

Scott
 
Use a report. Add store to the sorting/gouping and in the group header for store set the ForceNewPage property to BeforeSection
 
That is what i was doing, but now i need to be able to email the store specific report to the store, so that does not enitely solve my problem. Hope you can still help me
 
You'll need to write your own code loop to read the Store table and run the report and email it for each store. I don't have any sample code that I can post for you but I'm sure that this code has been posted. Try searching the archives.

Dim db As DAO.Database
Dim QD1 As DAO.QueryDef
Dim RS1 As DAO.Recordset
Set db = CodeDb

Set QD1 = db.QueryDefs!QYourQuery
Set RS1= QD1.OpenRecordset
Do Until RS1.EOF
email report for this store
RS1.MoveNext ' Locate next record
Loop
 

Users who are viewing this thread

Back
Top Bottom