Hide a button based on the value in another field on the form

S

Sandy

Hello -

How do I set the Visible property of a button to NO based on the value in
another field for each record in the details section of a form?


many thanks
sandy
 
D

Damian S

Hi Sandy,

Use the On Current event for your form. And do something like this:

if me.FIELD_TO_CHECK = VALUE_EXPECTED then
me.COMMAND_BUTTON_TO_HIDE.visible = false
else
me.COMMAND_BUTTON_TO_HIDE.visible = true
end if

Hope this helps.

Damian.
 
F

fredg

Hello -

How do I set the Visible property of a button to NO based on the value in
another field for each record in the details section of a form?

many thanks
sandy

In the [SomeControl] AfterUpdate event, as well as the Form's Current
event, write:

Me.CommandButton.Visible = Me![SomeControl] = some criteria
 
S

Sandy

Hi Damian,

I looked at the code and as far as I can tell,

clsConditionalFormatting only allows one to programmatically set the
Conditional Formatting properties of a TextBox. I need to set the visible
propery of a Command Button

modConditionalFormatting module does not work for subforms.

I am not great at modules so I may have missed something....
 
Top