Solved

Export Access Queries to different sheets in Excel

Posted on 2009-05-12
2
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 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