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

Setting record sort order in subform

Status
Not open for further replies.

njitter

Technical User
Sep 4, 2001
122
US
Hello,

i have got a form with a linked subform. I would like to have the subform display it's records in reverse order (by ID).

I have been unable to set the sort on this subform :(

Search did not come up with a solution..

---
It's never too late to do the Right thing
 
Take a look at the DESC option of the ORDER BY clause.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This was the first thing i did try.

OrderBy : Guidance_ID DESC



---
It's never too late to do the Right thing
 
You must also set the OrderByOn property to True.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes!

I did this:

Code:
Private Sub Form_Open(Cancel As Integer)
Me.OrderByOn = True
End Sub
and this:

Code:
Private Sub Form_AfterInsert()
Me.Requery
End Sub

along with the OrderBy in the Form.

The Subform works like i intended it to work now...


---
It's never too late to do the Right thing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top