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

Command Button that Sorts?

Status
Not open for further replies.

Minuet

Technical User
Dec 18, 2002
48
CA
Is it possible to program a command button in a form to, when clicked, sort records in ascending order?
 
You will want to user the OrderBy property. Example 1, sorts by last name in ascending order. Example 2 sorts by last name in descending order.

Example 1:

Me.OrderBy = "strLastName"
Me.OrderByOn = True

Example 2:

Me.OrderBy = "strLastName Desc"
Me.OrderByOn = True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top