hiding a section of sub-report with code

M

Mark Kubicki

from code behind a main report, how can i make one of the sections of a sub
report visible or not?


i would have expected something like:

me.srptName.form.detail.visible = "false"

(no?) - except when i add code the VB auto fill does not take me to this
place; i also tried:
me.srptName.section(acDetail).visible = "false"
(no luck here either)


thanks in advance,
mark
 
G

Guest

Hi Mark

If you never want to see the section of the report you can set the property
to visible = No.

If you want to hide the section if something else is there or something else
is a certain value, null, over/under a certain amount etc etc etc
use something like

Private Sub Report_Open(Cancel As Integer)
If Me.Something = SomeValue Then
me.Section.Visible = False
Else 'You can leave this line off if you want'
me.Section.Visible = True 'You can leave this line off if you want'
End If
End Sub

Or you can set this from the form that you are calling the report from using
the OnClick of the Open Report Button etc etc

Hope this helps
 

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