Make subform not visible on my Report with code

G

Guest

I have a report with several subforms (I did not design this mess). One of
the subforms is not only a subform on a reoprt but it is also nested into
another subform on the same report (it looks like it is). What I need is to
have that suform not show if the option box on my main form is false. The
comments work correctly however I have a blank section (page on report) where
the comments use to be. This could be a 1/4, 1/2 or a full page depening on
how many comments I have. Can someone direct me to the correct solution

Here is my code..

If Forms!frmMain!Comment = True Then

Me.[rsubJoseReport-InProcessComments].Visible = True

Else

Me.[rsubJoseReport-InProcessComments].Visible = False

Me.[rsubJoseReport-InProcessComments].Height = 0

End If
 
M

Marshall Barton

TKM said:
I have a report with several subforms (I did not design this mess). One of
the subforms is not only a subform on a reoprt but it is also nested into
another subform on the same report (it looks like it is). What I need is to
have that suform not show if the option box on my main form is false. The
comments work correctly however I have a blank section (page on report) where
the comments use to be. This could be a 1/4, 1/2 or a full page depening on
how many comments I have. Can someone direct me to the correct solution

Here is my code..

If Forms!frmMain!Comment = True Then

Me.[rsubJoseReport-InProcessComments].Visible = True

Else

Me.[rsubJoseReport-InProcessComments].Visible = False

Me.[rsubJoseReport-InProcessComments].Height = 0

End If


Setting the Height to 0 won't help here.

I think (never tried it with subform instead of subreport)
all you need is set both the subform control and its
section's CanShrink to Yes. This way, the report should
reclaim all the subform's space when it is invisible.
 

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