Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export/Import in Access XP

Status
Not open for further replies.

RoseV

Programmer
Mar 18, 2003
37
US
I run an exporting procedure that scrolls thru and sends different queries to the same file location, creating multiple worksheets within the workbook. I can also use this method to format the spreadsheets after they are created. Why can I not do this in reverse when I import the same spreadsheets? It will only the first worksheet. Is there no way to specify the worksheets on an import transferspreadsheet?

EXPORT CODE:
sFile = "S:\MFReports\CA-Income" & nDate2 & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINExch", sFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINDiv", sFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINEq", sFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINFee", sFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINFract", sFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "QryCAINUAF", sFile

since they all go to the same location, excel generates a new worksheet for each qry sent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top