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

Order of records

Status
Not open for further replies.

akirk

Technical User
Mar 28, 2002
27
US
I have a form used for data entry by 2 people based on a table. Until yesterday, the form was set up so that the first record was record 1, and the form showed each record in ascending order. Yesterday, the form started showing records in a seemingly random order.

The order is correct in the table, and as far as I can tell, the primary key in the table is still the auto number which provides the record number.

Any idea how to fix this form so that the records are back in numerical order?

Thanks

kirk
 
Things to check on form properties:
1) see if anybody has set the OrderBy property or turned OrderBy on.
2) see if filters have been set up to limit the records displayed.
3) If the form is based on a query which is based on a table, have they added an ORDER BY clause to sort it in a different order, or changed a previous one?

John
 
Forms have a .Filter and a .OrderBy property. These properties are set by the user when they click on the SortAscending, SortDescending toolbar buttons or on the FilterBySelection buttons. The settings can be inadvertently saved when, upon exiting the form, the form asks if you want to save changes. The hidden meaning is "do you want to save design changes" but Microsoft doesn't tell you this. So, thinking they are saving data changes, the user selects YES.

The user can un-press the ApplyFilter tool to remove these changes, or as the designer, you can prevent them from being saved in code, as follows:

When you close the form from code, be sure to use
Code:
DoCmd.Close _
  ObjectType:=acForm, _
  ObjectName:="Form Name", _
  Save:=
acSaveNo

--Shaun Merrill
 
Great found the problem--thanks for the help.

kirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top