View Full Version : Option of Including Subreport


Hotwheels59
06-21-2010, 07:16 AM
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.CheckExperi ence) = 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.

ChrisO
06-21-2010, 01:41 PM
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