Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Sorting problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 18 Oct 2005 20:38 GMT
Hi All,

I wish to sort by different fields at the user's discretion by using buttons
as headers and clicking the button sorts ascending or desending if it was
ascending previously.

I have the following code

Private Sub Label9_Click()
If Me.OrderBy = "Shipper City" Then
       Me.OrderBy = "Shipper City DESC"
   Else
       Me.OrderBy = "Shipper City"
   End If
   Me.OrderByOn = True

End Sub

It sorts ascending but does not reverse when clicked again like I believe it
should.  Any ideas?

Thanks in advance.
Mike
Klatuu - 18 Oct 2005 21:29 GMT
Try adding this line as the last line in your sub:
Me.Requery

> Hi All,
>
[quoted text clipped - 19 lines]
> Thanks in advance.
> Mike
Mike - 18 Oct 2005 21:41 GMT
I added that without success.  Thanks for the idea though.
> Try adding this line as the last line in your sub:
> Me.Requery
[quoted text clipped - 22 lines]
> > Thanks in advance.
> > Mike
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.