Sorting Records in Code

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
 
W

Wayne Morgan

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.
 
J

James

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





.
 
W

Wayne Morgan

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

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

James

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?


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top