Best way to make report sections optional ?

M

mscertified

I have a report that has several sections of data that are optional.
The user indicates this by checkboxes on the form that runs the report.
What is the best way to do this, make them subreports even though the data
is all in the same table row?
 
M

Marshall Barton

mscertified said:
I have a report that has several sections of data that are optional.
The user indicates this by checkboxes on the form that runs the report.
What is the best way to do this, make them subreports even though the data
is all in the same table row?


Insufficient information ;-)

What do you mean by "sections of data"?

If it's actual report sections, then add code to the
section's Format event procedure:
Cancel = Forms!theform.thissectioncheckbox

If it's just some text boxes in the detail section, then
make them invisible:
Dim bolSection As Boolean
bolSection = Forms!theform.sectionAcheckbox
Me.thisbox.Visible = bolSection
Me.thatbox.Visible = bolSection
, , ,
bolSection = Forms!theform.sectionBcheckbox
Me.otherbox.Visible = bolSection
, , ,
 
A

Armen Stein

Insufficient information ;-)

What do you mean by "sections of data"?

If it's actual report sections, then add code to the
section's Format event procedure:
Cancel = Forms!theform.thissectioncheckbox

If it's just some text boxes in the detail section, then
make them invisible:
Dim bolSection As Boolean
bolSection = Forms!theform.sectionAcheckbox
Me.thisbox.Visible = bolSection
Me.thatbox.Visible = bolSection
, , ,
bolSection = Forms!theform.sectionBcheckbox
Me.otherbox.Visible = bolSection
, , ,

Well, if the checkbox indicates that the section is "On", then you'll
need to flip it with a Not:

Cancel = Not Forms!theform.thissectioncheckbox

And if you use the visibility technique, and if you want your whole
report to shrink when those controls are hidden, set Can Shrink on
your sections and fields, and make sure no controls are side-by-side
or overlapping, as these will cancel the shrinkage. So to speak. :)

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

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