S
S Jackson
I am trying to use Visual Basic to set the Source Object property for a
subreport in my main report. The subreport is an unbound control named
"rsubReport." Based on the value of a control on the main form named
"Actn," I would like the Source Object for rsubReport to be either
"rsubCaseInfoSheet" or "rsubCaseInfoSheet2." I put the event procedure
under the On Format property of the main report's Detail section. The error
VB gives me with the following code is "Run-time error '2191': You can't
set the Source Object property after printing has started." Where can I
put this event procedure so that it will work?
FYI:
Dim strReport As String
Select Case Me.Actn = Value
Case "CNA", "NFA", "CMA"
strReport = "rsubCaseInfoSheet2"
Case Else
strReport = "rsubCaseInfoSheet"
End Select
Me.rsubReport.SourceObject = "strReport"
subreport in my main report. The subreport is an unbound control named
"rsubReport." Based on the value of a control on the main form named
"Actn," I would like the Source Object for rsubReport to be either
"rsubCaseInfoSheet" or "rsubCaseInfoSheet2." I put the event procedure
under the On Format property of the main report's Detail section. The error
VB gives me with the following code is "Run-time error '2191': You can't
set the Source Object property after printing has started." Where can I
put this event procedure so that it will work?
FYI:
Dim strReport As String
Select Case Me.Actn = Value
Case "CNA", "NFA", "CMA"
strReport = "rsubCaseInfoSheet2"
Case Else
strReport = "rsubCaseInfoSheet"
End Select
Me.rsubReport.SourceObject = "strReport"