Sorting Records in Code

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hello I have the following code...

SortForm ("MediaType")
OrderBy = "Acending"
Then By ("Title")
OrderBy = "Acending"


It does not work at all...

I would like the sort order to sort the mediatype in
acending order and then the title by acending order so
that when its finished it will have a media type in
alphabetical order and the titles for that media type in
alphabetical order then when it goes to the next media
type (when the user scrolls down) It goes to teh next
media type and then the titles for that are all
alphabetical order...

How do I achieve this?

Many Thanks

James
 
Base the form on a query, not directly from the table. In the query you can
specify sorting. The sort is done in the order the fields are listed in the
query, from left to right.
 
How would I do it though code?

Many Thanks

James
-----Original Message-----
Base the form on a query, not directly from the table. In the query you can
specify sorting. The sort is done in the order the fields are listed in the
query, from left to right.

--
Wayne Morgan
MS Access MVP





.
 
Me.OrderBy = "[MediaType], [Title]"
Me.OrderByOn = True

Ascending is the default, for decending:
Me.OrderBy = "[MediaType] DESC, [Title] DESC"
Me.OrderByOn = True
 
Thanks for that woked a treat

James
-----Original Message-----
Me.OrderBy = "[MediaType], [Title]"
Me.OrderByOn = True

Ascending is the default, for decending:
Me.OrderBy = "[MediaType] DESC, [Title] DESC"
Me.OrderByOn = True

--
Wayne Morgan
MS Access MVP


How would I do it though code?


.
 
Back
Top