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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending Table with no auto number to one with an Autonumber?

Status
Not open for further replies.

stazza18

IS-IT--Management
Jun 1, 2004
25
US
I am currently trying to import an excel spreadsheet into my database. The problem is that I need primary key that is made up on an autonumber along with the imported information. Any ideas on how I can get this done? The import function keeps telling me I have to keep the table the same as the spreadsheet.
 
Are you doing this import manually, via a macro, or VBA?
 
I was doing it was a transfer spreadsheet macro into a table.
 
Import the data into a temporary table. Then load the data into your target table.

 
I was trying to do that but I can't seem to get the autonumber field to work with the temporary table. I keep getting errors when I append the temporary table to the permanent table that has the autonumber field.
 
Have a look at this in Help:

Change the starting value of an incrementing AutoNumber field

 
I think you can import all the fields and left the autonumber out of the import so it fills itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top