Hi. I'm relatively new to reports in access. So please be patient.
I have a report based on a query. Depending on a selection a user makes from an option group on a form, I would like a group header to be created that reflects their selection.
Eg Sort by Leader or Sort By Category
I have tried creating a group level, but it doesn't work and generates an error "Expected End Sub".
Private Sub Report_Open(Cancel As Integer)
Sub CreateGL()
Dim varGroupLevel As Variant
varGroupLevel = CreateGroupLevel("R_Generic_Report", "IIf(Forms!F_ReportsMenu!SortBy_Op_Group=1,M_HASIFDB.Relevant_Leader,M_HASIFDB.Category)", _
True, True)
Reports!OrderReport.Section(acGroupLevel1Header).Height = 400
Reports!OrderReport.Section(acGroupLevel1Footer).Height = 10
End Sub
End Sub
Is there a way of creating a variable header(and sorting) based on the option group selection from a form?
Thanks in advance. Azalea.
I have a report based on a query. Depending on a selection a user makes from an option group on a form, I would like a group header to be created that reflects their selection.
Eg Sort by Leader or Sort By Category
I have tried creating a group level, but it doesn't work and generates an error "Expected End Sub".
Private Sub Report_Open(Cancel As Integer)
Sub CreateGL()
Dim varGroupLevel As Variant
varGroupLevel = CreateGroupLevel("R_Generic_Report", "IIf(Forms!F_ReportsMenu!SortBy_Op_Group=1,M_HASIFDB.Relevant_Leader,M_HASIFDB.Category)", _
True, True)
Reports!OrderReport.Section(acGroupLevel1Header).Height = 400
Reports!OrderReport.Section(acGroupLevel1Footer).Height = 10
End Sub
End Sub
Is there a way of creating a variable header(and sorting) based on the option group selection from a form?
Thanks in advance. Azalea.