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

Sort records using vb 1

Status
Not open for further replies.

DwayneS

Instructor
Mar 29, 2002
70
I'm learning, but not very good yet. I can't find this in the forum.

I have a simple button that calls a form. I want to sort the records different ways with different buttons. The one I have done does this:

Private Sub fOpenByAmt_Click()
DoCmd.OpenForm "fExceptionsProcess", , , "tExceptions.ClearedDate Is Null", , , "ORDERBY tExceptions.Amt DESC"
End Sub

It doesn't sort. How to do that? I know how to do it with copies of the form, but I really don't have to copy the form and re-open it with different queries, do I?

Dwayne Streeter, CPA, CITP
 
need to set the Orderbyon property to true. Not sure how you are using the openargs parameter.

Private Sub fOpenByAmt_Click()
DoCmd.OpenForm "fExceptionsProcess", , ,
"tExceptions.ClearedDate Is Null"
with forms(""fExceptionsProcess")
.orderBy = "tExceptions.Amt DESC"
.orderbyOn = true
end with
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top