From: Ian King on
Access and Windows XP.

I have a survey report with multiple subreports on it, and one of these
subreports (with pictures) has three varaiations, dependent on an option
selected by the user. I presently have three versions of the main report to
cover this, but this seems heavy handed.

What I'd like to do is set the SourceObject of the variable subreport
according to the user's choice, but I can't seem to acheive this at runtime.
Can it be done?

Alternatively, I could have the three versions of the subreport on the main
report, and set visibility accordingly, The question here is; does the
formatting and code on the hidden reports still run, using processing time?

The groups help would be greatly appreciated.

Ian King


From: David Lloyd on
Ian:

Have you tried using the Report Open event to set the SourceObject property
of the subreport? Seems to work in simple testing.

Something like:

Private Sub Report_Open(Cancel As Integer)
If Forms!Form1!chk2 Then
Me.subReport.SourceObject = "Report2"
ElseIf Forms!Form1!chk3 Then
Me.subReport.SourceObject = "Report3"
End If

End Sub

HTH

David Lloyd
Lemington Consulting
http://lemingtonit.com

"Ian King" <ian(a)labukltd.co.uk> wrote in message
news:pp6dnS_69OAHWX_WnZ2dnUVZ8gmdnZ2d(a)posted.griffininternet...
> Access and Windows XP.
>
> I have a survey report with multiple subreports on it, and one of these
> subreports (with pictures) has three varaiations, dependent on an option
> selected by the user. I presently have three versions of the main report
> to cover this, but this seems heavy handed.
>
> What I'd like to do is set the SourceObject of the variable subreport
> according to the user's choice, but I can't seem to acheive this at
> runtime. Can it be done?
>
> Alternatively, I could have the three versions of the subreport on the
> main report, and set visibility accordingly, The question here is; does
> the formatting and code on the hidden reports still run, using processing
> time?
>
> The groups help would be greatly appreciated.
>
> Ian King
>
>