Thank you Ken - worked perfectly!
I perhaps should have added to my question, the fact that I wasn't opening
the main report directly, but was using OutputTo acOutputReport to export
the report to a rtf document - but this solution still works!
Thanks again.
R
"Ken Sheridan" <(E-Mail Removed)> wrote in message
news:F50D3BB8-5D54-4745-816B-(E-Mail Removed)...
> Robin:
>
> In the Format event procedure of whichever section of the parent report
> the
> subreport is in put:
>
> On Error resume Next
> SubReportControl.Visible = Forms!YourForm!YourCheckBox
>
> If the check box is checked (TRUE) the subreport will be visible, if not
> (FALSE) it will be hidden. Note that SubReportControl is the name of the
> subreport control in the parent report, i.e. the control which houses the
> subreport, not the name of its underlying Report object.
>
> The error handling means the line will be ignored if the form is not open,
> e.g. if the report is opened directly from the database window.
>
> Ken Sheridan
> Stafford, England
>
> "Robin" wrote:
>
>> I have a report which contains a number of subreports and I wish to
>> show/hide these based on user checkbox choices on a form before the
>> report
>> is opened. I can manually hide the subreports by changing their visible
>> property. Is this possible from vbe and if so, do the subreports (or the
>> main report) need to be open at the time, and could someone possibly give
>> me
>> a clue as to the syntax?
>>
>> I seem to be going round in circles at the moment!
>>
>> Thx
>>
>> Robin
>
|