D
Drew
Hi All,
I will soon have a bunch of text files, each containing one record in
a comma-delimited file (they are the results of a detailed online
survey). My plan was to have command button that would automatically
import one file and append the record it contained to the main table.
This part is easily done with transfertext.
However, I would like to add the date when the record was imported
and, more importantly, the textfile name (to avoid importing the same
one twice). I have a set of functions that I use regularly that would
allow one to browse for the file and parse out the file name (thanks
to kind newsgroup member) which would be stored in a variable.
My question is, how do I get the filename from a variable in my
procedure added to the record before/while it gets appended to the
table? Can I 1)use transfertext to get the record into a recordset,
2)then add the new fields and values to the recordset, and 3)append
the recordset to the table? If so, how do I import to a recordset
from a delimited file and how do I add a new field to a recordset
(hey, I have avoided recordsets entirely until recently).
The other idea I had was to use transfertext to create a temporary
table, then have an append query ready to add the record from the
temporary table to the main table along with the date and file name.
The temporary table would have to get deleted every time.
Any ideas?
Thanks, and sorry this is so long. Drew.
I will soon have a bunch of text files, each containing one record in
a comma-delimited file (they are the results of a detailed online
survey). My plan was to have command button that would automatically
import one file and append the record it contained to the main table.
This part is easily done with transfertext.
However, I would like to add the date when the record was imported
and, more importantly, the textfile name (to avoid importing the same
one twice). I have a set of functions that I use regularly that would
allow one to browse for the file and parse out the file name (thanks
to kind newsgroup member) which would be stored in a variable.
My question is, how do I get the filename from a variable in my
procedure added to the record before/while it gets appended to the
table? Can I 1)use transfertext to get the record into a recordset,
2)then add the new fields and values to the recordset, and 3)append
the recordset to the table? If so, how do I import to a recordset
from a delimited file and how do I add a new field to a recordset
(hey, I have avoided recordsets entirely until recently).
The other idea I had was to use transfertext to create a temporary
table, then have an append query ready to add the record from the
temporary table to the main table along with the date and file name.
The temporary table would have to get deleted every time.
Any ideas?
Thanks, and sorry this is so long. Drew.