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

Form sorting?

Status
Not open for further replies.

bcblair

MIS
Feb 17, 2000
45
0
0
US
hOW DO i SET A FORM WHERE IT ALLWAYS SORTS BY A SINGLE FIELD?
 
You can set the RecordSource for your form to a query which is sorted by any field in the table. You are suppoed to be able to set the Forms Order By property to a string representation of the FieldName and have the records appear in the order but I haven't been able to get this feature to work consistently.

The query is the quickest way to do what you want to do . Just create a query and select all the fields in the table. Select the field that you want to sort by and set the Sort row to Ascending or Descending. Save the query and change the RecordSource of your form to the Query name.

This should get you on the right track.

Bob Scriver
 
I set that up , but I forgot to say it is a subform. If I look at it alone it is in order, but in the subform it is not.
 
The same holds true for a subform. The RecordSource property can have a query selected for all of the fields in the table with the Sort setup for the single field that you want to see it sort by.

The mainform has its own recordsource. Double-click on the subform object on the main form and this will bring into view the nested subform. Select the subform's properties and in the RecordSource select the query that you have created with the records sorted properly.

This should handle your situation.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top