MattBaldry
Self Taught, Learn from the Forums
- Local time
- Today, 23:12
- Joined
- Feb 5, 2019
- Messages
- 330
Hi all,
I am exporting 3 queries to a spreadsheet for import into another program. Export works fine, but 1 tab is giving me issues.
The tab needs to be named Bill of Material Records. But when exported it replaces the space with an underscore, Bill_of_Material_Records.
Does anyone know how I could export it with the spaces? I tried & space(1) & between each word, but this still had the _ on the tab name.
I also tried naming the query to the exact tab name I wanted, still had the _
~Matt
I am exporting 3 queries to a spreadsheet for import into another program. Export works fine, but 1 tab is giving me issues.
The tab needs to be named Bill of Material Records. But when exported it replaces the space with an underscore, Bill_of_Material_Records.
Does anyone know how I could export it with the spaces? I tried & space(1) & between each word, but this still had the _ on the tab name.
I also tried naming the query to the exact tab name I wanted, still had the _
Code:
Dim strFilePath As String
strFilePath = "C:\Users\" & Environ$("Username") & "\Desktop\"
Dim strFileName As String
strFileName = "Scott Cables Quote BOM Import " & [Forms]![frmQuote]![txtQuoteID] & ").xlsx"
DoCmd.SetWarnings False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qryCIM50BOMOperationImport", strFilePath + strFileName, True, "Operations"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qryCIM50BOMComponentImport", strFilePath + strFileName, True, "Components"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qryCIM50BOMRecordImport", strFilePath + strFileName, True, "Bill of Material Records"
DoCmd.SetWarnings True
~Matt