hide label & checkbox if .....

B

~Bigred

Hello All,

I have a report that

has a unbound Label (Label31) & unbound Checkbox (Box18).

If would like to HIDE both the label & checkbox from the report, if a field
in the main table (OpenInformation) is true

If the checkbox for a person is "checked" then I would like the label &
checkbox on the report to be hidden?

TIA,
_Bigred
 
K

Klatuu

The Activate event of a report would not be the correct event. The Activate
event only fires when the report receives the focus. The correct event would
be the Format event of the section the control you want to use to hide or
show the check box and label are in. Most likely, it will be the detail
event.

For example purposes, we will call the control for that field txtBoo.

So it would be:

Me.Label31.Visible = Not Me.txtBoo
Me.Box18.Visible = Not Me.txtBoo
 
H

Hunter57

Hi Klatuu,

While the Format event is more commonly used for setting report controls at
runtime, the Ativate event actually occurs *before* the Report has focus.

In VBA Help the example given makes visible a toolbar on the activate event
and makes it not visible on the deactivate event.

If it is good enough for a toolbar it is good enough for a control.

Regards,

Patrick Wood
 
K

Klatuu

Sorry, you are wrong about that. The Activate event fires once, unless you
move the focust to something else. Then when you move it back again, it will
fire again.
The format event will fire for each record. That is what you need to happen.

If you know the answer, why did you post the question?
 
H

Hunter57

Hi Klatuu,

You are right, the activate event fires only once unless the focus is moved
to another Access Object. I was not aware that he needed the code for every
record. My bad. Thanks for the input.

Pat Wood
 
B

~Bigred

Me.Label31.Visible = Not Me.txtBoo
Me.Box18.Visible = Not Me.txtBoo


Hello Klatuu,

I am having trouble figuring this out (since im a beginner level user).

I don't understand the

Me.txtBoo portion of your formula/code.

The source is
a table named "OpenInformation"
the field i want to use is a YES/NO field named "Unassigned".

I want the Label31 & Box18 to be hidden on my REPORT is the Unassigned value
is YES.

So what do you put where you have txtBoo ????

TIA,
~Bigred
 
K

Klatuu

When working in a form, you don't (usually) address the table and field
names. You use the control names to which the fields are bound, so where I
have txtBoo, replace it with the name of the control that Unassigned is bound
to.
 

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