To hide cmd

  • Thread starter Thread starter an
  • Start date Start date
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
 
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).
 
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
 
I woul'd like, for default:
Me!commandbuttonname.Visible = False

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

Thanks.
an
 
I have:

OnLoad
Me.cmdRefresh.Visible = False

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

Don't work.
Thanks.
an
 
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
 
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.
 
My textbox already return the correct result.
My need:
When average change the command button were visible.

Thanks.
an
 
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.
 
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.
 
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
 
Back
Top