Solved

Export Access Queries to different sheets in Excel

Posted on 2009-05-12
2
238 Views
Last Modified: 2012-06-21
Hi Experts

The following runs to two separate excel sheets but i'm trying to get the data to run to sheet 1 and then sheet 2 in the same excel workbook.

any help or suggestions is greatly appreciated :)

ozgirl

  DoCmd.OpenForm "PleaseWait", acNormal, "", "", acReadOnly, acNormal
    DoCmd.RepaintObject acForm, "PleaseWait"
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qryDataDump_Cleanse"
    DoCmd.SetWarnings True
    DoCmd.Close acForm, "PleaseWait"
    DoCmd.OutputTo acTable, "tmpDataDump", "MicrosoftExcelBiff5(*.xls)", "", True, "", 0
    DoCmd.OpenQuery "qryDataDump_Cleanse_Tasks"
    DoCmd.OutputTo acTable, "tmpDataDump_b", "MicrosoftExcelBiff5(*.xls)", "", True, "", 0
    DoCmd.SetWarnings True
    DoCmd.Close acForm, "PleaseWait"
0
Comment
Question by:ozgirl
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 24370606
docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName1","C:\myExcel.xls",true,"Sheet1"

docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName2","C:\myExcel.xls",true,"Sheet2"
0
 

Author Closing Comment

by:ozgirl
ID: 31580797
Thanks Heaps  :)
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question