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!

Order By Question 1

Status
Not open for further replies.

whodeycp

MIS
Oct 11, 2007
14
0
0
US
Is there a way to order by two fields descending in vba? i know that it is possible for ascending. Here is an example of what I am trying to do:

If Me.OrderBy = "[Plan],[Year]" Then
Me.OrderBy = "[Plan],[Year] DESC"
Else
Me.OrderBy = "[Plan],[Year]"
End If
Form.OrderByOn = True

It works for ascending but not descending.
 
How about:
Code:
Me.OrderBy = "[Plan] DESC,[Year] DESC"
Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
That works great. Thanks Harley, I was stuck there.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top