Field size when importing from Excel

D

Dave

The text fields come in as 255 characters when importing. Is there a way
that the import sets the filed size to the character width in the excel
column?

Or is there a way to set the width on the import. I bring a large employee
db in once a month, and I have to chnage the filed widths each time or the
db is huge.

Thanks
 
K

Klatuu

It appears you are importing into a new table. Your default text field size
in your database appears to be set to 255. The better way to control field
sizes and data types is to import to an existing table.
Create a table with the data types and field sizes you want. Then import
into that table. You will, of course have to clear the table's data prior to
the import. You can do that with one simple line of code:

CurrentDb.Execute("DELETE * FROM mytablenamehere;"), dbFailOnError
 

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