Re: Hide Field on Click

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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





.



Relevant Pages

  • Re: Hide Field on Click
    ... It would be much easier if you used an option group with two ... report will be looking at the option group on the form to know what to do. ... Make one button's Caption "Without Pricing" and its ... The advantage over the command buttons is that command buttons ...
    (microsoft.public.access.reports)
  • Re: Pulling data between 2 date controls & check boxes
    ... Maybe an option group would work best. ... Have one command button to run the report. ... Select Case grpRange ...
    (microsoft.public.access.reports)
  • Re: Option Groups
    ... go back to my original plan to use an Option Group with Preview and Print ... "Crazy Lady" wrote: ... I have found Command Button Report Selection. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Hide Field on Click
    ... I'm not clear, from your description, where you would expect the "command ... Then, in the report, as it formatted the section with this info, I'd have it ... What I have is a quote with pricing on it. ...
    (microsoft.public.access.reports)
  • RE: Event Procedure on a Command Button in a form
    ... So if you select a toggle button under option 1 I'll pick ... print the report, if you select option 2, Choose what from where?, and option ... Option group 3 meaning = Search Option and Toggle Button has a option value ... And then, click a command button ...
    (microsoft.public.access.forms)