Hello,
I'm trying to set the properties of a sub report without opening in design view. Is this even possible? I thought I could set the properties after I've dimmed the report variable and set it equal to an existing report, but if I take the docmd.openreport statement out, I get an error.
Is there any way to set the properties without opening the report?
Many thanks........
Sub InvestServTier(BizUnit As Integer)
On Error GoTo FreeWilly
Dim str As String
Dim TierLevel As Integer
Dim rpt1 As Report, rpt2 As Report, rpt3 As Report
Dim rpt1_name As String, rpt2_name As String, rpt3_name As String
rpt1_name = "A1_rptDivisionServiceLevels"
rpt2_name = "A1_rptBUTotal"
rpt3_name = "A1_rptConsultTotal"
DoCmd.OpenReport rpt2_name, acViewDesign, , , acHidden
Set rpt2 = Reports.Item(rpt2_name)
With rpt2
.Filter = "[tblRelationshipByTier].[BU Indicator] = " & BizUnit
'''.Properties.Item("Filter") = "[tblRelationshipByTier].[BU Indicator]=1"
End With
DoCmd.Close acReport, rpt2_name, acSaveYes
Set rpt2 = Nothing
I'm trying to set the properties of a sub report without opening in design view. Is this even possible? I thought I could set the properties after I've dimmed the report variable and set it equal to an existing report, but if I take the docmd.openreport statement out, I get an error.
Is there any way to set the properties without opening the report?
Many thanks........
Sub InvestServTier(BizUnit As Integer)
On Error GoTo FreeWilly
Dim str As String
Dim TierLevel As Integer
Dim rpt1 As Report, rpt2 As Report, rpt3 As Report
Dim rpt1_name As String, rpt2_name As String, rpt3_name As String
rpt1_name = "A1_rptDivisionServiceLevels"
rpt2_name = "A1_rptBUTotal"
rpt3_name = "A1_rptConsultTotal"
DoCmd.OpenReport rpt2_name, acViewDesign, , , acHidden
Set rpt2 = Reports.Item(rpt2_name)
With rpt2
.Filter = "[tblRelationshipByTier].[BU Indicator] = " & BizUnit
'''.Properties.Item("Filter") = "[tblRelationshipByTier].[BU Indicator]=1"
End With
DoCmd.Close acReport, rpt2_name, acSaveYes
Set rpt2 = Nothing