Re: Hide Field on Click
- From: "Pam" <pamnospam@xxxxxxxxxxxxxxxx>
- Date: Fri, 17 Nov 2006 16:32:31 -0600
Thanks both Jeff and Klatuu. I think I like your ideas much better. It
seems to be a smoother procedure. I will work on it.
"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B89C636F-F740-42B0-A116-979CD4A54140@xxxxxxxxxxxxxxxx
You can't determine, from a report, whether a command button has been
selected. It would be much easier if you used an option group with two
toggle buttons. Using an option group requires no additional coding;
however, using one or more command buttons takes some coding. It is also
necessary that the form be open while the report is printing, because the
report will be looking at the option group on the form to know what to do.
For the Option group. Make one button's Caption "Without Pricing" and its
Option Value = 0. Make the other button "With Pricing" and an OptionValue
=
-1.
When you click on the With Pricing button, the Option Group will return a
value of -1 (True) and when you click an Without Pricing, it will be 0
(False). The advantage over the command buttons is that command buttons
return no value, but an option group does. Yes, you could use the Tag
property of a command button, but in this case, you would have to check
both
command buttons Tag property, as well as keep them correct with code.
Now we need a little code in the report. It should go in the On Print
event
of the section of the report the controls you want to hide are in. It is
as
simple as this:
Me.Price.Visible = Forms!MyFormName!MyOptionGroupName
Me.PriceExtension.Visible = Forms!MyFormName!MyOptionGroupName
"Pam" wrote:
Hi,
I'm looking for a way to make a field either visible or not based on
command
button selected. I've searched thru posts and have found visible with
conditional formatting- not quite what I want to do.
What I have is a quote with pricing on it. I want to click on a command
button "Quote With Pricing" and have all the pricing printed on report.
If
I click other button "Quote Without Pricing", I want to use the same
report
and not have the pricing printed.
Main Quote is "rQuote"
Subreport is "rQuotePartsSubreport"
Fields to hide/unhide are "Price" and "PriceExtension"
It sounds easy enough, but not sure how to go about it.
Any help is greatly appreciated!
Thanks,
Pam
.
- Follow-Ups:
- Re: Hide Field on Click
- From: Klatuu
- Re: Hide Field on Click
- References:
- Hide Field on Click
- From: Pam
- Hide Field on Click
- Prev by Date: Re: Referencing subreport field on main report
- Next by Date: Re: Summing and counting in Reports
- Previous by thread: Re: Hide Field on Click
- Next by thread: Re: Hide Field on Click
- Index(es):
Relevant Pages
|