dynamic queries

marleyuk

Registered User.
Local time
Today, 23:15
Joined
Feb 8, 2006
Messages
54
i have a database that imports files with dynamic amounts of fields, runs querys on the data and outputs it to a speadsheet. The The problem is instead of making it run querys on each column, i have it running on them all collectively. Now i want to change it so a query is run on each column then output to its own spreadsheet. Does anyone know how to do this?
 
No sure what you mean by column, I presume you mean field. Anyhow, if you use the transfer spreadsheet method to output your data, query or table, you can have each output saved to a different worksheet as long as you output to the same file name. The sheet name will be based on the name of your query. You will obviously need to create a query to extract the required field(column) By the way, this code is courtesy of GHudson.


Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query1", "PathName.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query2", "PathName.xls", True
 

Users who are viewing this thread

Back
Top Bottom