To hide cmd

A

an

Hi!

I have a form with a text box where is the result of a calculated average.
In this form I'd like to hide a command button to be visible only when that
value is changed.

Thanks in advance.
an
 
J

John W. Vinson

Hi!

I have a form with a text box where is the result of a calculated average.
In this form I'd like to hide a command button to be visible only when that
value is changed.

Thanks in advance.
an

You'll have to explain this. Are you trying to make the command button
invisible (if so how could you click it)? Under what circumstances would the
button become visible or invisible?

You would use code to toggle the button's Visible property:

Me!commandbuttonname.Visible = Not(Me!commandbuttonname.Visible)

will make it visible if it's not, and hide it if it is. The code would go in
some appropriate form event (depending on your answer to the question above).
 
Z

zuckermanf

Hi!

I have a form with a text box where is the result of a calculated average..
In this form I'd like to hide a command button to be visible only when that
value is changed.

Thanks in advance.
an

Set the visible property of the button to false in design view.
Use the After Update event of the textbox to change the visible
property to true.
Me.btnCommand.Visible = True
Fred
 
A

an

I woul'd like, for default:
Me!commandbuttonname.Visible = False

If change value (of the average textbox)
Me!commandbuttonname.Visible = True

Thanks.
an
 
A

an

I have:

OnLoad
Me.cmdRefresh.Visible = False

Texbox (with average)
AfterUpdate
Me.cmdRefresh.Visible = True

Don't work.
Thanks.
an
 
Z

zuckermanf

If your textbox is a calculated control (ie: the calculated average of
other text boxes), then you must use the AfterUpdate event of every
textbox used in the calculation.
Fred
 
J

John W. Vinson

I woul'd like, for default:
Me!commandbuttonname.Visible = False

If change value (of the average textbox)
Me!commandbuttonname.Visible = True

Set it to FALSE in the form's Current event (which will fire when you open the
form and when you move to a different record).

Set it to TRUE in the AfterUpdate event of *each control* which is involved in
the calculation of the average textbox. You have not said how the average is
calculated so I really don't know what event that would be; but the update
events on the calculated textbox won't fire when the value changes, you'll
need to use an event further back in the chain.
 
A

an

My textbox already return the correct result.
My need:
When average change the command button were visible.

Thanks.
an
 
J

John W. Vinson

My textbox already return the correct result.
My need:
When average change the command button were visible.

Reread Fred's and my messages.

The fact that the textbox is correct is not the issue.
 
J

John W. Vinson

JW

Nor do I understand.
Already doubt the configuration of access.

Please post your code for the button and any textboxes involved; the Control
Source of the calculated textbox would be very helpful, as would the
Recordsource of the form.

We're all struggling in the dark here because we cannot see your computer and
you haven't posted any information that would help us answer your questions.
 
A

an

Sorry JW.
Problem solved with

in OnLoad of the form
[Forms]![F_Calc]![cmdRefresh].Visible = False
and
in SubForm field
[Forms]![F_Calc]![cmdRefresh].Visible = True

Thank you very much.
an
 
Ì

ÌìµØÈË

111111111111111111111111111111111
an said:
I have:

OnLoad
Me.cmdRefresh.Visible = False

Texbox (with average)
AfterUpdate
Me.cmdRefresh.Visible = True

Don't work.
Thanks.
an
 

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

Similar Threads


Top