Good afternoon,
I think (hope) this is a simple query.
I have created a Macro to pull data from a stored ".csv" file into a table already saved in Access, by re writing over the current data.
The issue is the file once its in could do with a column (or the whole) table trimming to make it easier for me to create queries as I currently have to have another column that trims a field.
Is there anyway I can add a line in to trim [Field3] before the "StatusMsg"?
Sorry if this is an easy one, but my brain is going to sleep after reading so much on it.
thanks in advance
Gavin
I think (hope) this is a simple query.
I have created a Macro to pull data from a stored ".csv" file into a table already saved in Access, by re writing over the current data.
The issue is the file once its in could do with a column (or the whole) table trimming to make it easier for me to create queries as I currently have to have another column that trims a field.
Is there anyway I can add a line in to trim [Field3] before the "StatusMsg"?
Code:
Sub ImportCSV(TableName, SourceFilepath, ImportMethod As String)
Dim StatusMsg As Variant
StatusMsg = SysCmd(acSysCmdSetStatus, "Clearing " & TableName)
DoCmd.RunSQL "DELETE * FROM " & TableName & ";"
StatusMsg = SysCmd(acSysCmdSetStatus, "Updating " & TableName)
DoCmd.TransferText acImportDelim, ImportMethod, TableName, SourceFilepath, True
StatusMsg = SysCmd(acSysCmdClearStatus)
End Sub
Sorry if this is an easy one, but my brain is going to sleep after reading so much on it.
thanks in advance
Gavin