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

Sort Subform?

Status
Not open for further replies.

jerseyboy

Technical User
Mar 7, 2002
127
US
If you have a form that has a subform, is it possible to sort the subform (either with a button or automatically)?

The main form in my db lists events, and the subform list the many people who are scheduled to attend said events.
The user can add attendess directly in the subform, but the second they do they are out of alphabetical order.

My goal is to put a 'reshuffle names' button to realign the attendes alphabetically by LastName, FirstName.

Here are some of the details...
Parent Form Name: frmEvents
Subform Name: subfrmEventAttendees
Control Name: txtLastName
Controls Table Field Name: LastName

I understand the order by property, but cannot seem to apply it correctly to this instance.

As always, any help no matter what type is appreciated. JerseyBoy
Remember: self-praise is no recommendation
 
You may have to 'requery' the sub-form to get the records to be displayed in sorted order.

I'm not entirely sure, but you may want to try putting a
me.requery
in the subform's afterupdate function.
 
Hi,

You will have to requery your subform. To get it to sort by LastName and FirstName you have to set the sorting for query that the subform uses. In your query where LastName and FirstName are listed there is a Field called "Sort". If you click on this field it will allow you to sort your info from A-Z, Z-A or unsorted. Set Sorting of LastName first then set sorting for FirstName.

HTH,

jbehrne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top