displaying a checkbox on a report

G

Guest

I have a parameter query tied to a form, that then prints out its results in a report. There are many checkboxes on the form. I would like the report to display the checkbox if the checkbox is selected in the form, if not, I don't want the checkbox to display. I'm thinking this can be accomplished with a simple vb code, but I don't know vb very well.

Any help is appreciated.
 
R

Rob

There is a way to do this without code, by using IIF() and
getting creative with your font selection.

Place an unbound text box on the report, and then set its
Control Source to:

=IIF([Forms]![formname]![checkboxname],"R")

Then change the font for this text box to WingDings2. The
result will be nothing if the checkbox on the form is not
set, and a square with a checkmark in it if the checkbox
is set.

To use a different graphic, you can change the R to a
different letter and/or select a different symbol font.

Rob


-----Original Message-----
I have a parameter query tied to a form, that then prints
out its results in a report. There are many checkboxes on
the form. I would like the report to display the checkbox
if the checkbox is selected in the form, if not, I don't
want the checkbox to display. I'm thinking this can be
accomplished with a simple vb code, but I don't know vb
very well.
 
G

Guest

Where did you come up with that little gem! I love it! It looks like a disaster to the person who accidentally goes into design mode of the report, but nobody will but me!

Rob said:
There is a way to do this without code, by using IIF() and
getting creative with your font selection.

Place an unbound text box on the report, and then set its
Control Source to:

=IIF([Forms]![formname]![checkboxname],"R")

Then change the font for this text box to WingDings2. The
result will be nothing if the checkbox on the form is not
set, and a square with a checkmark in it if the checkbox
is set.

To use a different graphic, you can change the R to a
different letter and/or select a different symbol font.

Rob


-----Original Message-----
I have a parameter query tied to a form, that then prints
out its results in a report. There are many checkboxes on
the form. I would like the report to display the checkbox
if the checkbox is selected in the form, if not, I don't
want the checkbox to display. I'm thinking this can be
accomplished with a simple vb code, but I don't know vb
very well.
Any help is appreciated.


.
 
G

Guest

One more question - what can be done about the labels for these checkboxes? I wouldn't want them to display either unless the checkbox was selected.

Thanks!

Rob said:
There is a way to do this without code, by using IIF() and
getting creative with your font selection.

Place an unbound text box on the report, and then set its
Control Source to:

=IIF([Forms]![formname]![checkboxname],"R")

Then change the font for this text box to WingDings2. The
result will be nothing if the checkbox on the form is not
set, and a square with a checkmark in it if the checkbox
is set.

To use a different graphic, you can change the R to a
different letter and/or select a different symbol font.

Rob


-----Original Message-----
I have a parameter query tied to a form, that then prints
out its results in a report. There are many checkboxes on
the form. I would like the report to display the checkbox
if the checkbox is selected in the form, if not, I don't
want the checkbox to display. I'm thinking this can be
accomplished with a simple vb code, but I don't know vb
very well.
Any help is appreciated.


.
 
R

Rob

Well, the easiest way to deal with the lables is to simply
get rid of them and make another copy your textbox that
generates the symbol. Replace the R with the proper text
and use a "real" font.

As for where it came from, I honestly don't remember.
I've been using variations of this for many years, on both
forms and reports. It likely came from something somebody
posted on this newsgroup long long ago, but unfortunately
I don't know who to give the proper credit.

Rob.

-----Original Message-----
One more question - what can be done about the labels for
these checkboxes? I wouldn't want them to display either
unless the checkbox was selected.
Thanks!

Rob said:
There is a way to do this without code, by using IIF() and
getting creative with your font selection.

Place an unbound text box on the report, and then set its
Control Source to:

=IIF([Forms]![formname]![checkboxname],"R")

Then change the font for this text box to WingDings2. The
result will be nothing if the checkbox on the form is not
set, and a square with a checkmark in it if the checkbox
is set.

To use a different graphic, you can change the R to a
different letter and/or select a different symbol font.

Rob


-----Original Message-----
I have a parameter query tied to a form, that then
prints
out its results in a report. There are many checkboxes on
the form. I would like the report to display the checkbox
if the checkbox is selected in the form, if not, I don't
want the checkbox to display. I'm thinking this can be
accomplished with a simple vb code, but I don't know vb
very well.
Any help is appreciated.


.
.
 

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