7871 The table name you entered doesn't follow Microsoft Office Access object-naming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CoreyReynolds
    New Member
    • Nov 2009
    • 29

    7871 The table name you entered doesn't follow Microsoft Office Access object-naming

    Hello all,

    I'm working with Access 2007 and my VB code is getting an error at:

    Code:
       DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
             strSourceName, strFileName, False
    I'm attempting to insert a query into that method, and I'm getting the error:

    7871 The table name you entered doesn't follow Microsoft Office Access object-naming rules
    strSourceName in the above code is the following query (Which, if I run on it's own, works! and returns the correct values!!!)

    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;
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Moved to relevant forum.

    Comment

    • CoreyReynolds
      New Member
      • Nov 2009
      • 29

      #3
      I figured out that I was passing in a string when I needed to create a QueryDef,

      not I'm getting an error saying "3274 external table is not in the expected format" at the same line.

      My SQL looks good to me and I don't see what would be wrong with my table design.

      Comment

      Working...