J
jenni
hello -
I have included my VBA code below. This is to import
all .csv files in a specified folder to one table.
I keep getting an error that points to the
Do.Cmd.TransferText line. But I cant figure out what it
is.
Any ideas????
Thanks,
Jenni
...........................................................
Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete
them.
'assumes they are all the correct format for an ASCII
delimited import.
Dim strfile As String
ChDir ("C:\Documents and Settings\jpfeifer.CCI\My
Documents\Mech\PR project\New472Format")
strfile = "Dir([*.*])"
Do While Len(strfile) > 0
DoCmd.TransferText [acImportDelim], [specs_Import472],
[tbl_472_Import], [("C:\Documents and
Settings\jpfeifer.CCI\My Documents\Mech\PR
project\New472Format") & ("strfile")], [False]
'delete the file (consider moving it to an Archive
folder instead.)
Kill "C:\Documents and Settings\jpfeifer.CCI\My
Documents\Mech\PR project\New472Format" & strfile
strfile = Dir
Loop
End Sub
I have included my VBA code below. This is to import
all .csv files in a specified folder to one table.
I keep getting an error that points to the
Do.Cmd.TransferText line. But I cant figure out what it
is.
Any ideas????
Thanks,
Jenni
...........................................................
Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete
them.
'assumes they are all the correct format for an ASCII
delimited import.
Dim strfile As String
ChDir ("C:\Documents and Settings\jpfeifer.CCI\My
Documents\Mech\PR project\New472Format")
strfile = "Dir([*.*])"
Do While Len(strfile) > 0
DoCmd.TransferText [acImportDelim], [specs_Import472],
[tbl_472_Import], [("C:\Documents and
Settings\jpfeifer.CCI\My Documents\Mech\PR
project\New472Format") & ("strfile")], [False]
'delete the file (consider moving it to an Archive
folder instead.)
Kill "C:\Documents and Settings\jpfeifer.CCI\My
Documents\Mech\PR project\New472Format" & strfile
strfile = Dir
Loop
End Sub