Hello all,
I'm working with Access 2007 and my VB code is getting an error at:
I'm attempting to insert a query into that method, and I'm getting the error:
strSourceName in the above code is the following query (Which, if I run on it's own, works! and returns the correct values!!!)
I'm working with Access 2007 and my VB code is getting an error at:
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
strSourceName, strFileName, False
7871 The table name you entered doesn't follow Microsoft Office Access object-naming rules
Code:
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;
Comment