• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

Pasting from excel

Hi All
I have a form with underlying table that I use to add data occationally by pasting from excel. In the table there are no filters no sort by fields or any other interfearence that I can see. When the data is pasted into the form it is correctly ordered as it was in excel, but the underlying table somehow stores the Data randomly rather than in the order that it was when pasted. I don't want to add any counter fields as there is already a autonumber (Set to Random) on the table linked to a parent.
I just cannot see any reason for the strange random storage. Any Ideas?
0
DatabaseDek
Asked:
DatabaseDek
  • 2
  • 2
1 Solution
 
pdebaetsCommented:
If your primary key is set to autonumber random, then that could explain why your records (when sorted by the primary key) appear random. I'd suggest setting the primary key to autonumber increment. Then a key will be assigned incrementally based on when it was pasted. This should preserve the order you pasted it in.
0
 
DatabaseDekAuthor Commented:
Hi pdebaets

Are you saying that even when sort order is set to not sorted that Access overrules this and sorts it anyway? Unfortunately I cannot use increment as I sometimes need to paste from other tables and if there is already that number in the system it will cause an error.

Thank you
0
 
pdebaetsCommented:
The default sort order for the table will be the primary key sort order. You can change this by sorting on a different field, then saving the table.

Your problem with pasting from another table would seem to exist regardless of whether you use autonumber increment or autonumber random.

You can force an autonumber field to start at a particular value. Perhaps you can start it after the maximum value of any record you might want to paste. More info is at: http://allenbrowne.com/ser-26.html
0
 
DatabaseDekAuthor Commented:
Thank you.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now