Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Export Access Queries to different sheets in Excel

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
ozgirl
Asked:
ozgirl
1 Solution
 
Rey Obrero (Capricorn1)Commented:
docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName1","C:\myExcel.xls",true,"Sheet1"

docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName2","C:\myExcel.xls",true,"Sheet2"
0
 
ozgirlAuthor Commented:
Thanks Heaps  :)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now