I am trying to set the sort order of my report by modifying the Me.GroupLevel
.ControlSource within the Report_Open event. When the report is previewed from design view everything works fine. When it is previewed from closed it never contains any data (NoData event fires too). The documentation clearly states you can alter it, even giving an example in the help.
Is it me? I can find only one KnowledgeBase article that mentions 'GroupLevel' at all.
Code example:
All the 'PlanningReport' variables are global, set within the Print button event before opening the report (most reliable way of getting non-bound data into a report I've found). The PlanningReportSortField is set to the name of the field I want to sort on - there is already a GroupLevel(0) with a header/footer section, so we are setting GroupLevel(1) to sort within each group.
BTW: Running Access 2000 SP3
Many thanks in advance.
Is it me? I can find only one KnowledgeBase article that mentions 'GroupLevel' at all.
Code example:
All the 'PlanningReport' variables are global, set within the Print button event before opening the report (most reliable way of getting non-bound data into a report I've found). The PlanningReportSortField is set to the name of the field I want to sort on - there is already a GroupLevel(0) with a header/footer section, so we are setting GroupLevel(1) to sort within each group.
Code:
Private Sub Report_Open(Cancel As Integer)
'*** This line here ***
Me.GroupLevel(1).ControlSource = PlanningReportSortField
'*** Yes, that one ***
Me.Caption = PlanningReportTitle
lblReportTitle.Caption = PlanningReportTitle
lblCriteria.Caption = PlanningReportCriteria
'This bit sets the data binding on the first of four text boxes on the detail section - works OK
txtField1.ControlSource = PlanningReportField1
Select Case PlanningReportField1
Case "iipLOCDate": lblField1.Caption = "LOC Date"
Case "iipLastReviewDate": lblField1.Caption = "Last Review"
Case "orgNoSiteEmployees": lblField1.Caption = "No Emps"
End Select
'etc.
BTW: Running Access 2000 SP3
Many thanks in advance.