Plz help with append data (1 Viewer)

Ossama22

Registered User.
Local time
Today, 17:52
Joined
Aug 31, 2018
Messages
52
Hello guys ,
I have a small issue with external data from excel to access , when i append data , for example i added 50 record , when i check my database i found alot of empty rows with auto number , so when i try to add more records , i cannot continue with row number 51 , it maybe around 1k empty rows , is there any solution
 

isladogs

MVP / VIP
Local time
Today, 15:52
Joined
Jan 14, 2017
Messages
18,213
Are you saying the autonumber field is also empty? Not sure how that's possible

Delete the empty rows using a suitable delete query and compact the database.

Now look at the design of your append query and identify why it's happening.
The most likely cause is that you are importing the entire Excel worksheet including empty rows and including the autonumber field in your query. If so, remove it.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:52
Joined
Feb 19, 2013
Messages
16,607
sounds like your excel sheet has lots of 'active' rows below the data you want to import. To check, open the excel file and click the end key followed by the home key which will take you to the bottom right of the active spreadsheet area.

To resolve, you need to delete these rows before importing or use a different import method - perhaps link to the spreadsheet and use an append query with a criteria to check if the row is empty (i.e. one or more fields are null) and exclude from the append if it is.

With regards maintaining consecutive PK numbers, this should not matter, it is just an identifying number and serves no other purpose than to uniquely identify a record. It's value is irrelevant and you should not assign any sort of meaning to it at all.
 

Users who are viewing this thread

Top Bottom