Importing text file into Access table

S

starlore

I need to import a comma-delimited text file saved from a Word form
into an Access table. The problem is that all the number fields, even
though marked as number fields on the form, are saved as text strings
in the text file. When I try to parse and convert them into the
appropriate number types (long, double, integer), I am consistently
getting a "type mismatch" error. For example, the string "1504" won't
convert to a long data type. I have tried the following code to make
this work with no success (varValue(i) being the string "1504"):

varValue(i) = cLng(varValue(i))
lngValue = cLng(varValue(i))

Am I overlooking something obvious? TIA for any help with this.
 
G

Guest

I've had more success importing first into an excel spreadsheet, getting the
data types right there, then importing the spreadsheet into access.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top