Discussion Locked

Access form data order

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a form in Access that allows data entry on a continuing basis. Each new entry is input at the end of the form then a new line is automatically added for the next entry. These entries are entered by date. However, after closing and reopening the form the last entry is at the beginning of the form and not at the end getting the dates out of order. This happens even when the user has made sure to save. What to do to correct this? Note: this doesn't happen all the time - it seems to occur on and after the fourth entry. Thank You.

7 replies

by raffi_

It sounds like there is no sort order at all enforced at the form level. A lot will depend on how the form was built in the first place.

If it is based on a query then you can modify the query to ORDER BY the field in question and then either ASC(ascending) or DESC (descending).

If it is based on a table then you can modify the form itself to force an order. Do a search in the Help on SORT FORMS for complete (and more in-depth than I can go into here) instructions.

Regards
Raffi_

by otl

It sounds like someone has gone to the Datasheet View, resorted the data then saved it.
To prevent this:
1. open the form in the datasheet view.
2. sort it the way you want it sorted
3. goto tools, security, user and groups permissions
4. click on the table/form you do not want them to modify and restrict them from modifying the design. (NOTE: you will have to do this for each user) They will be able to sort any way they want but can not make it the default way it will appear when someone else opens the table/form.

by bob sellman

There are two things you can do.

First, base the form on a query which just selects all columns in the table the form currently uses, but be sure to set the query so the records are sorted in the order you need. This may mean setting the date asthe main sort and a second column (even the primary key autonumber column mentioned below) as the second sorting column. The second sorting column would have to be one that would identify what order records for the same date were added (which the autonumber column would).

Second, it appears from your question that people may enter records with the same date. You also don't state if more than one user is entering data at the same time. If you add an autonumber column which is set as the primary key the table should be displayed (if no sorting has been set in the form or in the query if you use a query as your record source for the form) in primary key order. Since the primary key is an autonumber column that will automatically be incremented every time a new record is added, the records will be displayed in the order they have been added. Note that this solution assumes that records as always being added in order by date, which may not be the case.

This discussion is closed to new replies.