Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferText: problems reading .csv file

Status
Not open for further replies.

cwarner

Programmer
May 9, 2003
46
0
0
GB
Hi,

I am using TransferText to read in a .csv file,
but it's not reading in the invoice # when it's
a combination of text and numeric, i.e. "VA12245",
it just brings in a blank field. It reads in
the all-number invoice #s fine. Any ideas
as to what's happening? I'm not using an import
spec because I'm reading in different files
every time (end-users have different files).

Here's my code:

If Me!fileformat = "Comma-delimited (.csv)" Then DoCmd.TransferText acImportDelim, , tbl_out, Me!fullfilename, True

Thanks for any help,
Christy.
 

You kinda answered your own question. If you are not using an import spec. then Access attemps to determine the data type "on the fly". If the number of fields do not change then I would set up a import spec. and define the invoice as a text field.

 
Hi,

I'm not sure if an import spec is the way to go, because I need to be very flexible in the files I am reading in. The end-user may have 5 fields or 10 fields, it just depends. And the columns can be named very differently and in different order. So I think I may try to find a way around using the "transfertext", there is one FAQ that addresses it but it looks quite involved.

Thanks for your help!
Christy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top