Option of Including Subreport

Hotwheels59

Registered User.
Local time
Yesterday, 21:46
Joined
Oct 12, 2009
Messages
13
I have a report that includes several subreports. I would like the option to exclude one or more of the subreports. I have included a column in the table to record whether a checkbox on the applicable form is checked or not. If the form is checked and thus recorded in the table, the intent is to make the sub-report not visible. I'm using the following code:

Private Sub CheckExperience()
If (Forms!sfrmExperienceDataInput_Subform.CheckExperience) = False Then
Me.rptExperience_Subreport.Visible = No
End Sub

However, it won't work. I'm a newbie at this stuff so clearly I'm missing something. Any ideas? Thanks in advance.
 
For one thing, there is a reasonable chance you are not using Option Explicit in the Report.

I think the word 'No' should be 'False' and that 'No' is a variant which is Empty and is being evaluated as False every time it is used.

Untested but try: -

Me.rptExperience_Subreport.Visible = Forms("sfrmExperienceDataInput_Subform").Form.CheckExperience
 

Users who are viewing this thread

Back
Top Bottom