Import Add

A

Aaron

I have the below code and when I run it, I receive the following error.
Error:
Run time Error: 2391
Field 'Comments' doesn't exist in destination table 'tblImportAdds'

But, I have the Comments field in the tblImportAdds???

Code
Private Sub import_adds_Click()

DoCmd.SetWarnings (0)

'scrub the previous load for the import table
DoCmd.RunSQL ("DELETE * FROM tblImportAdds")
DoCmd.RunSQL ("DELETE * FROM tblTempHold")

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel5,
"tblImportAdds", "H:\MAT_MGMT\HP Desk Top\HP-SLR Price Files\Price File Adds
v2.xls", True

'append tblImportAdd data to the Temp hold table
DoCmd.OpenQuery "qryAppendImportFileToTempHold"
DoCmd.OpenQuery "qryUpdateTempHold"
DoCmd.OpenQuery "qryTempHold_Canada"
DoCmd.OpenQuery "qryTempHold_LAC"
DoCmd.OpenQuery "qryTempHold_Brazil"
DoCmd.OpenQuery "qry_AppendCanada"
DoCmd.OpenQuery "qry_AppendLAC"
DoCmd.OpenQuery "qry_AppendBrazil"
DoCmd.OpenQuery "qryUpdateHubServiceFee"
DoCmd.OpenQuery "qryUpdateTotals&WarrantyCredits"
DoCmd.OpenQuery "qryUpdateTotalsForAdditionalLCDCost"
DoCmd.OpenQuery "qryUpdateRecordsWithBERFlagSet"
DoCmd.OpenQuery "qryUpdateIWCC_OOWCC"
'qryUpdateHDD_OOWCC currently turned off due to all OOW values set to zero
'DoCmd.OpenQuery "qryUpdateHDD_OOWCC"
DoCmd.OpenQuery "qryUpdateFSLFee"

MsgBox "Complete"

DoCmd.OpenTable "tblTempHold", acViewNormal

DoCmd.SetWarnings (-1)

End Sub


Thanks in Advance, Aaron
 
A

Aaron

Sorry to waste everyone time, I figured it out. There was a space in front of
Comments in the excel sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top