Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem importing Excel data 1

Status
Not open for further replies.

CuckooNut

MIS
Oct 22, 2009
23
US
I am trying to import a column of data from an Excel file into an Access database table. The data I am trying to import is the last 4 digits of each employee's SSN. I have a column in an Excel spreadsheet that contains that information. Because the last 4 digits of some people's SSN start with a zero, I had to convert this column to text format, since Excel drops leading zeros in the number format.

The code I have written in Access to import the data seems to be working like it should for the most part. The problem I am running into occurs after I edit a cell in this column in the Excel file. Once I have edited a cell, I get the little warning message in the corner of the cell that tells me I have a number stored as text, and then when I run the code again in Access, I get an "Invalid Use of Null" error once the loop reaches that particular cell.

Any ideas as to why this might be happening and what I can do to fix it?

Thanks!
 


Hi,

You cannot mix text and numeric in the same column and query.
[red]
FIX ALL YOUR DATA!
[/red]

SSN data, like and IDENTIFIER data ought to be TEXT, regardless of whether the individual characters are all numeric or not. You will NEVER do arithmetic on identifiers. The LENGTH of the value is significant. Leading Zeros are significant. ALL these facts mitigate against store these values as numbers. They should ALWAYS be stored as TEXT!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top