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 / General 1 / December 2006

Tip: Looking for answers? Try searching our database.

sorting data on continous form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karl - 15 Dec 2006 15:02 GMT
I have a continous form based on 1 table.
On the form I have a button that sets the OrderBy to as follows

DataSource = Me.RecordSource

If Me.OrderBy = DataSource & ".PaymentDate DESC" Then
   Me.OrderBy = DataSource & ".PaymentDate"
   Exit Sub
End If

Me.OrderBy = DataSource & ".PaymentDate DESC"

This works fine most of the time but sometimes clicking the button doesn't
sort the data. This usually happens after data has been added to the
underlying table and Requery has been run on the form. I can exit the form.
re-open it and click the up or down arrows once then my sort button will
work.

Any ideas on how to make the button work all time?
Allen Browne - 15 Dec 2006 15:14 GMT
After setting the order, make sure OrderByOn is turned on:
   Me.OrderByOn = True

Before it can change the sorting, Access has to save any edits that are in
progress. It is always a good idea to do this explicitly:
   If Me.Dirty Then Me.Dirty = False

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a continous form based on 1 table.
> On the form I have a button that sets the OrderBy to as follows
[quoted text clipped - 15 lines]
>
> Any ideas on how to make the button work all time?
 
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.