INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Problem importing Excel data

Problem importing Excel data

(OP)
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!

RE: Problem importing Excel data



Hi,

You cannot mix text and numeric in the same column and query.

FIX ALL YOUR DATA!  

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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Problem importing Excel data

(OP)
That did it.  Thank you!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close