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!

Sorting Multiple fields on a Form.. I just can't work it out.

Status
Not open for further replies.

Modex

Programmer
Sep 15, 2002
155
0
0
GB
Hi All,

While I'm in Access mode, I wonder if I could ask one other question that has been troubling me for some time.

I need to be able, on a click of a button to firstly sort a primary field ie "The Date" and then I need to be able to do a secondary sort on the "TIME".

Very much like selecting DATE as the first sorted column and the TIME as the next sorted colum in a query.

I am not sure how do to this in code.

For a Single Sorted column I use:

Me.Date.SetFocus
DoCmd.RunCommand acCmdSortDescending


If I then use

Me.Time.SetFocus
DoCmd.RunCommand acCmdSortDescending

it sorts all the records in the time order and what I actually need is date,then time sorted for that date and then the date and time sorted in that date etc etc.

Any help would be gratefully received.

many thanks

ModeX :)
 
Simply play with the OrderBy and OrderByOn properties of the Form.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top