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 / May 2007

Tip: Looking for answers? Try searching our database.

Sorting a Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TDS - 27 May 2007 21:03 GMT
I have a subform that displays in datasheet view. I would like to have
several buttons on the main form that sort the subform by different columns,
asc or desc. I have tried to use a setvalue macro to set the orderby setting
on the form, but that does not work. Also tried setting the record source
prop on the sub form - get an error on this also.

Any suggestions?

Terry
Scott McDaniel - 27 May 2007 21:16 GMT
>I have a subform that displays in datasheet view. I would like to have
>several buttons on the main form that sort the subform by different columns,
>asc or desc. I have tried to use a setvalue macro to set the orderby setting
>on the form, but that does not work. Also tried setting the record source
>prop on the sub form - get an error on this also.

You may not be referring to the subform correctly. The correct syntax is:

Me.NameOfYourSubformCONTROL.Form.PropertyOrOther

NameOfYourSubformCONTROL is the name of the Subform control that's on the main form, and may or may not be the name of
the form being used as a subform ... check your syntax carefully and make sure you've got that right

That said: You also must turn OrderBy on:

Me.SubformControl.Form.OrderBy="SomeColumn"
Me.SubformControl.Form.OrderByOn = True

You can also set the Recordsource of the subform with the ORDER BY clause:

Me.SubformControl.Form.Recordsource = "SELECT * FROM SomeTable ORDER BY SomeColumn"

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
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.