show/hide SubReport

G

Guest

Hi all,

Is it possible to have a subreport show/hide based on a checkbox selection?
I have a form with the following event:

Private Sub PercentRent_AfterUpdate()
'After Update of checkbox
'Check if Percentage Rent checkbox is selected
'then show or hide subform
If Me.PercentRent = True Then
Me.frmPercentRent.Visible = True
Else
Me.frmPercentRent.Visible = False
End If

Can I do something like this on the report?

Thanks
 
M

Marshall Barton

D. M. said:
Is it possible to have a subreport show/hide based on a checkbox selection?
I have a form with the following event:

Private Sub PercentRent_AfterUpdate()
'After Update of checkbox
'Check if Percentage Rent checkbox is selected
'then show or hide subform
If Me.PercentRent = True Then
Me.frmPercentRent.Visible = True
Else
Me.frmPercentRent.Visible = False
End If

Can I do something like this on the report?


No. Report's are static objects that do not support
interactive components the way forms do.

The usual usual thing to do is use a form for users to
select report options (such as your check box) and the set
the appropriate properties in the report's Open event:

Sub Report_Open( . . .
If Forms!theform.PercentRent = True Then
Me.frmPercentRent.Visible = True
Else
Me.frmPercentRent.Visible = False
End If
End Sub
 
G

Guest

Thanks Marshall. It was a just a thought.

Marshall Barton said:
No. Report's are static objects that do not support
interactive components the way forms do.

The usual usual thing to do is use a form for users to
select report options (such as your check box) and the set
the appropriate properties in the report's Open event:

Sub Report_Open( . . .
If Forms!theform.PercentRent = True Then
Me.frmPercentRent.Visible = True
Else
Me.frmPercentRent.Visible = False
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top