Adjusting fields from Excel to Access import

  • Thread starter Thread starter Greg Gatto
  • Start date Start date
G

Greg Gatto

Please help me out. I'm currently running Office
Professional 2003. I'm trying to import an Excel
spreadsheet into Access. I use the "Get External Data"
command and follow the instructions - no problem. Until
I get to the screen where I can click on each column,
specify the field name and characteristics (text format
vs. number format, etc.) No matter which column I
highlight, I can only make changes to the first column.

Thanks for any help you can provide.

Sincerely,
Greg
 
You have never been able to change datatypes in the Excel import wizard.
(Not sure why you think you can do it for the first field.)

Here are some general tips:
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.
 
I am having the same problem as the original poster. When
you click on the 2nd column so that it is highlighted, the
field name, indexed, and do not import field settings for
the first column remain displayed under field options.
Same for any other column. It's as if changing the
highlighted column below has no effect on anything in
field options. I haven't tried this from text, but ours
is clearly broken importing from Excel.
 
Yes, this is exactly the problem! I guess I wasn't clear
in my original post...the problem is not just data types
themselves, it's also whether or not I want to import
that particular column or not, etc. etc. Essentially, I
cannot pick any of the options for any column except the
first column, no matter what column I click on.

Thanks for your affirmation...I was beginning to think I
was nuts.

Greg
 
It isn't really broken.
It has always worked that way.
The Text wizard is much nicer because it is a different bit of code.
 
I forgot to put my e-mail in last time, but Access wasn't
that way in Access 2002. Some of our machines still use
2002, and when I click on a column in 2002, the field
name, indexed, and do not import settings change with it.
I just tested it with the same Excel spreadsheet I've been
trying to convert with 2003 to make sure. This makes me
think something in 2003 is broken. I can't see why making
it where one can't change field name importing from Excel
is a "feature" that was needed in 2003. My personal
guess, the code is broken and a Microsoft fix is needed.
 
OK.
I was thinking about the inability to change the datatype.

On my PC I have 4 versions of Access 97, 2000, 2002, 2003.

My 2002 and 2003 both act the same way as you describe.
I wonder if the install of 2003 caused 2002 behavior to change since you say
it does not work that way on your PC.
 
FYI
This has been confirmed as a bug.
Final resolution has not been determined yet.
Obviously, we all hope for it to be in a SP but no guarantees.
 
Back
Top