Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pasting from excel

Posted on 2011-09-17
4
Medium Priority
?
346 Views
Last Modified: 2013-11-28
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
Comment
Question by:DatabaseDek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:pdebaets
ID: 36555126
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
 

Author Comment

by:DatabaseDek
ID: 36556048
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
 
LVL 12

Accepted Solution

by:
pdebaets earned 2000 total points
ID: 36556764
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
 

Author Closing Comment

by:DatabaseDek
ID: 36559039
Thank you.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question