Save Access Query to multiple files

Hello,
I need some help. I have an access query that I wish to group and output by customer number as excel files.

CustomerNo
InvoiceNo  
Date          

The saved file names should be equal to the customerNo.
Thank in advance.
_HectorAsked:
Who is Participating?
 
Jeffrey CoachmanMIS LiasonCommented:
To do this in the standard way  you would have to have two tables:
tblCustomers (Parent)
tblInvoices (Child)

Then create a query from the Invoice table that accepts the CustomerNo as a parameter (from a combination of a Public Variable and a Public Function)

Then create a loop of the customer table, this will supply the unique CustomerID to the query parameter and output it to a file.
...Then keep looping for the rest of the customers.

Sample attached
Database127.mdb
0
 
jjafferrCommented:
Hi

Did you try the
DoCmd.TransferSpreadsheet 1, 8, "Query1", "C:\" & me.Customer & ".xls", True

jaffer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.