Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting a sub-report

Status
Not open for further replies.

Richey

Technical User
Aug 29, 2000
121
GB
Hi

I have a form, frmreports, with an unbound combo box, cmb_sort, containing total_score and category.

If the user chooses total_score and clicks open report it launches a report, rptstrats, with a sub-report called tblstratssubreport.

I want to apply sorting within the sub-report tblstratssubreport, dependent on what they chose from the unbound combo-box

I have the following code, but the order by doesn't work.
any ideas?
thanks

Dim stDocName As String

stDocName = "rptstrats"
DoCmd.OpenReport stDocName, acPreview
Reports![rptstrats]![tblstratssubreport].Report.OrderBy = Forms!frmreports![cmb_sort]
 
I think you need to turn the 'order by' on by adding

Reports![rptstrats]![tblstratssubreport].Report.OrderByON = True

Hope this helps

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top