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
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