Import Spreadsheet Wizard

L

LISSJMC

Inside my Import Spreadsheet Wizard when I get to Field Options box, my Data Type option is greyed out. I would like to use this area to set my data types. What is the problem?
Thanks
John
 
K

Ken Snell

No problem...ACCESS does not make the data type function available to you
when importing a spreadsheet.


--
Ken Snell
<MS ACCESS MVP>

LISSJMC said:
Inside my Import Spreadsheet Wizard when I get to Field Options box, my
Data Type option is greyed out. I would like to use this area to set my data
types. What is the problem?
 
J

Joe Fallon

In addition to Ken's correct statement here are some things to consider:

Since Excel is not a database, using "mixed" data types in a column causes a
problem when Access has to "guess" which one to use. Access examines the
first 15 rows (or so) and makes a guess. If you want to "force" Access to
guess a text data type then make the first entry in that column a text
value. The reason you get errors is that the first 15 rows are all numeric
and then the text data shows up after Access has already guessed the data
type to be Numeric.

The way to make a text value in your data of numbers is to include a
character!
e.g. 123A

========================================================
Other good advice from John Nurick:
The Access routine that imports Excel data doesn't allow direct control
over the types of the fields it creates, and often runs into trouble
with Excel columns that contain a mix of numeric and text values.

You can work round this in any of the following ways:

1) create the table yourself with the field types you need, then import
the spreadsheet data. The field names in the table must exactly match
the column headings in Excel.

2) make sure that at least one row near the top of the Excel table
contains values that can only be interpreted as the data types you need
(e.g. text that cannot be interpreted as a number if you want the column
to become a text field). Sometimes the simplest way to do this is to
insert a first row of "dummy" data into Excel just for this, and then
delete it from the Access table once the data has been imported.

3) Access assigns field types on the basis of the data it finds in the
first dozen or so rows of the spreadsheet table. It pays no attention to
cell formats. Sometimes a useful trick is to put an apostrophe ' in
front of numeric values in the cells (e.g. '999): this forces Excel and
Access to treat them as text, but the apostrophe is not displayed in
Excel or imported into Access.

(Just to make things more confusing, the Access applies different rules
when you're linking Excel data rather than importing it. Simplifying
somewhat: when importing, any text value in the first few rows will
cause a field to be imported as text. When linking, any *numeric* value
in the first few rows will cause a field to be linked as numeric even if
all the other values are non-numeric.)

3) Write your own import code using Automation to get the values direct
from the worksheet cells and recordset operations or queries to append
them into your table.

--
Joe Fallon
Access MVP



LISSJMC said:
Inside my Import Spreadsheet Wizard when I get to Field Options box, my
Data Type option is greyed out. I would like to use this area to set my data
types. What is the problem?
 
J

JClarke

Are you sure this is always the case? Because the Help screen for this task specifically instructs you to check the data type Access has assigned and change it when appropriate

----- Ken Snell wrote: ----

No problem...ACCESS does not make the data type function available to yo
when importing a spreadsheet


--
Ken Snel
<MS ACCESS MVP

LISSJMC said:
Inside my Import Spreadsheet Wizard when I get to Field Options box, m
Data Type option is greyed out. I would like to use this area to set my dat
types. What is the problem
 
K

Ken Snell

Yes, I'm sure. You can change the data type for a text file that is being
imported, but not an EXCEL spreadsheet that is being imported.

Help can be confusing and sometimes misleading....

--
Ken Snell
<MS ACCESS MVP>

JClarke said:
Are you sure this is always the case? Because the Help screen for this
task specifically instructs you to check the data type Access has assigned
and change it when appropriate.
 

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