Code for bringing daily data into Excel

kloot1rr

Registered User.
Local time
Today, 15:27
Joined
Jun 10, 2015
Messages
39
Hey all - I am totally new to coding but I am trying to transfer daily data that I get from three different queries all into one Excel sheet. I take it that you have to make one over-arching query which I have made called Awaiting Base. Check out my attachments to see if you think I have it decently setup.
 

Attachments

  • 11.png
    11.png
    27.9 KB · Views: 98
  • 12.png
    12.png
    9.6 KB · Views: 91
  • 13.png
    13.png
    21.4 KB · Views: 94
send query into 1 sheet? or 1 workbook, w 3 sheets?

'if workbook and if all the data has the same fields,
you can make a union query and export all 3 at once in a single statment.
docmd.transferspreadsheet

'if separate workSHEETS, then use the 3 different
docmd.transferspreadsheet to the same xlfile but different TABS
 
Yeah I am looking for one excel sheet with 3 different tabs, would that be the second option then? Thanks for the help!
 
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry, vFile, True, "Tab1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry, vFile, True, "Tab2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry, vFile, True, "Tab3"
 

Users who are viewing this thread

Back
Top Bottom