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

G

Guest

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
 
G

Guest

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
 
G

Guest

Hi guys -

These two solutions work but they do not apply to each record individually
but to all the records - The visible property changes as I go to each record.

I made this a sub form instead of using the detail section of the main form
and the same thing happens here.

any ideas?
 
G

Guest

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....
 

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