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 / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Ordering records in a subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Warren - 01 Jun 2006 01:03 GMT
Form A contains Form B as a subform
in Form B's onopen event I have set the sort order as:

Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = "[datetimecreated] DESC"
End Sub

When the Form A opens and I select a record the detail records in Form B
fail to be ordered as required.

So how, and where should I put the code to force the proper sorting of the
records.

Thanks,

Ed Warren.
Tom Lake - 01 Jun 2006 02:29 GMT
> So how, and where should I put the code to force the proper sorting of the
> records.

Create a query sorted the way you want and use it for Form B's source.

Tom Lake
Ed Warren - 01 Jun 2006 03:08 GMT
Thanks, sometimes the really stupid tricks are overlooked!!! I was making
this much too hard.

Ed Warren.

>> So how, and where should I put the code to force the proper sorting of
>> the records.
>
> Create a query sorted the way you want and use it for Form B's source.
>
> Tom Lake
Ron2006 - 02 Jun 2006 19:37 GMT
Whenever you want to programmatically set the sort order or the filter
you also have to set that action on.

Example:

Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = "[datetimecreated] DESC"
Me.OrderByOn = true
End Sub
 
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.