I'm working with Access 2007 and my VB code is getting an error at:
Expand|Select|Wrap|Line Numbers
- DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
- strSourceName, strFileName, False
7871 The table name you entered doesn't follow Microsoft Office Access object-naming rulesstrSourceName in the above code is the following query (Which, if I run on it's own, works! and returns the correct values!!!)
Expand|Select|Wrap|Line Numbers
- SELECT tblEquipment.equipmentID,
- tblCompartment.compartmentCode,
- tblSample.sampleNumber,
- tblSampleResult.Cu
- FROM
- ((
- tblEquipment INNER JOIN tblCompartment ON
- tblEquipment.[equipmentID] = tblCompartment.[equipmentID]
- )
- INNER JOIN tblSample ON
- tblCompartment.[compartmentAutoID] = tblSample.[compartmentSpecific]
- )
- INNER JOIN tblSampleResult ON
- tblSample.[sampleNumber] = tblSampleResult.[sampleCode]
- WHERE tblCompartment.compartmentCode=1 AND
- tblEquipment.equipmentID=26646;