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!

Setting Properties of Subreport

Status
Not open for further replies.

bajo71

Programmer
Aug 6, 2007
135
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top