Microsoft
Software
Hardware
Network
Question : Does "DoCmd.TransferSpreadsheet<wbr /> acImport" allow you to append records to an Access table ?
When using
DoCmd.TransferSpreadsheet acImport
into an Access database, is there a way to import the spreadsheets as additions to the existing records in a table as opposed to overwriting the table with
totally new records (additions vs. inserts) ?
In other words could I loop through a series of spreadsheets and import them individually and append the records to an Access table.
Thus, if I have 5 spreadsheets with 20 records each, could I loop through
the spreasheets using DoCmd.TransferSpreadsheet and accumulate 100 records in the table as a result of importing 5 separate spreasheets ?
Answer : Does "DoCmd.TransferSpreadsheet<wbr /> acImport" allow you to append records to an Access table ?
Part of the process implemented in the solution you were looking at was to have a table of files which had been previously imported, to prevent re-importing the same data.
If you check the entire thread, you will see reference to that.
If you are not trying to track imported filenames, then those parts of the code can be commented out.
Private Sub ConsolidateXLS()
Dim myfile As String
Dim str_sql As String
myfile = Dir("c:\strip\branchest*.x
ls")
Dim file_exist As Integer
Do While myfile <> ""
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblExcelFiles", "c:\strip\" & myfile, True, ""
DoCmd.RunSQL (str_sql)
myfile = Dir
Loop
End Sub
if you are trying to track imported file names, you will have to create tblImportStatus.
Random Solutions
Dicom to Jpeg Image Conversion
Installing ISA Server 2004, guide, walkthrough or step by step
HOWTO: Programatically Configure Error Pages Features Settings in IIS 7.0
Filter, Add New Sheet, Delete All Sheets
IF EXISTS versus IF NOT EXISTS problem.
SBS 2003 drops *most* Internet connections every three hours
Does CMap support multi-threading?
Folders being created - Outlook Calendar, Outlook Contacts
Togglelink
Mandatory Range of Cells in Excel