I need to prepare weekly reports on how our sales people are doing, and currently have one query for each salesperson (~10). I have a button on a form that exports all of these queries to Excel, using commands like this:
DoCmd.OutputTo acOutputQuery, "QueryName" , acFormatXLS, QueryName-1.xls"
This works--but if I get a new salesperson, I need to create a new query and modify some code. If the criteria for the query changes, I need to change it 10 times.
I have table that stores information about the salespeople (tblSalespeople ), and I'd like to create a loop that runs the query for each tblSalespeople. salespersonName and exports it to Excel.
What is the best way to do that?
DoCmd.OutputTo acOutputQuery, "QueryName" , acFormatXLS, QueryName-1.xls"
This works--but if I get a new salesperson, I need to create a new query and modify some code. If the criteria for the query changes, I need to change it 10 times.
I have table that stores information about the salespeople (tblSalespeople ), and I'd like to create a loop that runs the query for each tblSalespeople. salespersonName and exports it to Excel.
What is the best way to do that?
Comment