By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 916 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Best way to export a table into Excel

P: 23
I want to create a button on a form that will automatically export the contents of a make table query into Excel. This query however is based on a combo box that selects the fiscal quarter for which the data should represent.

I was wondering what the best way to do this was and also have some way that Excel would show the quarter number that is being represented. Access reports can just link to the combo box but what about in Excel?

Any and all help would be truly appreciated.

Oct 25 '06 #1
Share this Question
Share on Google+
1 Reply

P: 143
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.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FiscalPeriod1", "PathNameToExcel:\MyFile.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FiscalPeriod2", "PathNameToExcel\MyFile.xls", True

You can define your criteria in the queries. If the users need to change [select] the criteria then you will have to embed the process in a form where the users can make [adjust] their criteria and the queries feed off of the forms selections.
Oct 25 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.