I want to import data into a table from a csv file. The table is failry lengthy but to try this out I have the following:
tblTest - the table I want the data to end up in
tblTestcsv - the intermediate table I empty then put the csv data into
test.csv - the csv file (obviously)
I have used somde code which gets the data into the tblTestcsv OK but then doesn't move it into the tblTest - I get an error each time.
Dim sSql As String
DoCmd.TransferText acImportDelim, , "tblTestcsv", sFileLocation, False
sSql = "INSERT INTO tblTest (forename,surname,phone) " & _
"SELECT F2,F3,F4" & _
"FROM tblTestcsv"
CurrentDb.Execute sSql
Any help as to waht I am doing wrong would be gratefully received.
tblTest - the table I want the data to end up in
tblTestcsv - the intermediate table I empty then put the csv data into
test.csv - the csv file (obviously)
I have used somde code which gets the data into the tblTestcsv OK but then doesn't move it into the tblTest - I get an error each time.
Dim sSql As String
DoCmd.TransferText acImportDelim, , "tblTestcsv", sFileLocation, False
sSql = "INSERT INTO tblTest (forename,surname,phone) " & _
"SELECT F2,F3,F4" & _
"FROM tblTestcsv"
CurrentDb.Execute sSql
Any help as to waht I am doing wrong would be gratefully received.