Data type Conversion from Excel inconsistency

R

Racer49

I have an Excel spreasheet that I import to Excel via Macro in Access. The
data type that gets imported from Excel from a column "Age" (which is numeric
data), gets changed to "Text" instead of seeing it as numeric. Is there a
way through my import Macro or VB to check its type, then change this type to
numeric?

Thanks
 
J

Jeff Boyce

Here's another approach that may help you circumvent the problem you're
seeing...

Create a "temp" table into which you'll import your Excel data ... and make
all the fields of type "text".

Import from Excel into that table.

Create queries that "convert" data from the temp table into the proper data
types, and appends (or updates) records in your more permanent Access
tables.

I mention a distinction between "temp" and "permanent" Access tables because
raw Excel data is rarely well normalized. If you want to get good use of
Access' relationally-oriented features and functions, you need to have a
well-normalized table structure.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

Racer49

That will work! I had not thought of the interim step of having my table be
permanent, then import from the "temp" file via query.. Thanks for this great
tip!
 

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