G
Guest
Help! Below is the code to automatically import all text files. This code
works great if the files are in the same layout, but causes data shifting if
the fields change. How do I modify the code to change it to update if the
file layout is different?
If varX = "text" Then
varH = Me.cboImportFileSelect
varI = Me.cboImportFileSelect.Column(1)
varJ = Me.cboImportFileSelect.Column(2)
varK = Me.cboImportFileSelect.Column(3)
varM = Me.List11
DoCmd.TransferText acImportDelim, varM, varH, varJ & varK, True, ""
Call AddSource(varH, "Source")
Call AddFileName(varH, "SourceDatabase")
Call AddCounter(varH, "ConversionID")
MsgBox "update complete"
End If
works great if the files are in the same layout, but causes data shifting if
the fields change. How do I modify the code to change it to update if the
file layout is different?
If varX = "text" Then
varH = Me.cboImportFileSelect
varI = Me.cboImportFileSelect.Column(1)
varJ = Me.cboImportFileSelect.Column(2)
varK = Me.cboImportFileSelect.Column(3)
varM = Me.List11
DoCmd.TransferText acImportDelim, varM, varH, varJ & varK, True, ""
Call AddSource(varH, "Source")
Call AddFileName(varH, "SourceDatabase")
Call AddCounter(varH, "ConversionID")
MsgBox "update complete"
End If