S
Snowypaws
I have code that will import files from the records listed in a table. Once
the file is imported, I create three fields in the table. After that, I need
to update the Source field in the table that I just created with a value from
the importable such as varH?
I have tried:
Dim SQL As String
SQL = "UPDATE varH " & "SET varH.Source = varH "
DoCmd.RunSQL SQL
Below is the code that it should be inserted into:
Private Sub cboImportFileSelect_AfterUpdate()
Dim varA As Variant
Dim varX As Variant
Dim intX As Integer
Dim intY As Integer
varA = Me.cboImportFileSelect
Dim varH As Variant
Dim varI As Variant
Dim varJ As Variant
Dim varK As Variant
varH = Me.cboImportFileSelect
varI = Me.cboImportFileSelect.Column(1)
varJ = Me.cboImportFileSelect.Column(2)
varK = Me.cboImportFileSelect.Column(3)
DoCmd.TransferSpreadsheet acImport, varI, varH, varJ & varK, True, ""
Call AddSource(varH, "Source") 'Creates source field
Call AddSourceDatabase(varH, "SourceDatabase") 'Creates SourceDatabase
field
Call AddCounter(varH, "ConversionID") 'Creates ConversionID
MsgBox "update complete"
End Sub
the file is imported, I create three fields in the table. After that, I need
to update the Source field in the table that I just created with a value from
the importable such as varH?
I have tried:
Dim SQL As String
SQL = "UPDATE varH " & "SET varH.Source = varH "
DoCmd.RunSQL SQL
Below is the code that it should be inserted into:
Private Sub cboImportFileSelect_AfterUpdate()
Dim varA As Variant
Dim varX As Variant
Dim intX As Integer
Dim intY As Integer
varA = Me.cboImportFileSelect
Dim varH As Variant
Dim varI As Variant
Dim varJ As Variant
Dim varK As Variant
varH = Me.cboImportFileSelect
varI = Me.cboImportFileSelect.Column(1)
varJ = Me.cboImportFileSelect.Column(2)
varK = Me.cboImportFileSelect.Column(3)
DoCmd.TransferSpreadsheet acImport, varI, varH, varJ & varK, True, ""
Call AddSource(varH, "Source") 'Creates source field
Call AddSourceDatabase(varH, "SourceDatabase") 'Creates SourceDatabase
field
Call AddCounter(varH, "ConversionID") 'Creates ConversionID
MsgBox "update complete"
End Sub