Import files into access

Joined
Apr 1, 2015
Messages
2
Reaction score
0
Hi

I have a form on access which allows users to upload csv files.
The files can be in any layout, so the field names and the number fields will always be different each time.
This can cause issues on data types, as access assumes a certain data type for a field, but the data may not always reflect that.

For example telephone numbers, access assumes this is a numeric field, however sometimes there will be symbols in this field such as +44. Which then causes import errors

Is there any way to import these files without getting these sort of errors?
Ideally if they could all be imported as text fields, this would solve all my problems, but I don't believe that is possible.

Currently the import process uses a simple TransferText method
DoCmd.TransferText acImportDelim, , "Original Data", Me.filelist.RowSource, True

This imports the data into a new table called 'Original Data'.

Any help or ideas would be greatly appreciated

Thanks
Rob
 
I had the idea of saving the table structure of the csv being imported
(Importing the data with errors, then deleting all the records to just leave the structure)
However I can't find a code to change the data types of that table to TEXT format, when I can't tell what the field names will be.

This whole thing is an automated process, which why there are loads barriers btw
 
Back
Top