For the purposes of the code example, let's say your form's name is frmF,
and the checkboxes are chkA, chkB, and chkC, and that you have named the
checkboxes in the report with identical names. And, the form must be open
when the report is running!
In the Print event of the Report:
Dim frm as Form
Set frm = Forms("frmF")
If frm!chkA = True Then Me!chkA.Visible = True
If frm!chkB = True Then Me!chkB.Visible = True
If frm!chkC = True Then Me!chkC.Visible = True
Set frm = Nothing
For the record: The code in an Access database is VBA (Visual Basic for
Applications), not vbscript. vbscript is an interpreted language, primarily
for web pages but usable elsewhere, supported by the Windows Scripting Host
(aka Windows Scripting Runtime). I do not recommend using vbscript with
Access applications because in many shops the system administrators have
removed the WSH from all machines because of the number of viruses and worms
that use vbscript to do their mischief.
Larry Linson
Microsoft Access MVP
kimc said:
I have a parameter query tied to a form, that prints its results in a
report. There are many checkboxes on the form. I want the checkboxes to
display in the report only if they are selected in the form. If the
checkbox is not selected, I don't want it to show up on the report. Can
this be accomplished using vb script?