disable button based on value

S

Steven Brookes

Hi all,

I have a button on a form called 'raise job' and a field called 'status', is
there anyway i can diasable the buton if the status is for example 'on stop'

Thanks in advance for your help.
 
S

speedo_in_oz

Steven Brookes said:
Hi all,

I have a button on a form called 'raise job' and a field called 'status', is
there anyway i can diasable the buton if the status is for example 'on stop'

Thanks in advance for your help.

Hi Steven,

You could add a private sub like the following to your form that you can
call after each event that changes the Status, when the form is opened or in
the Form_current event.

Private Sub SetButton()
If me.Status = "on stop" then
btn_raise.enabled = False
Else
btn_raise.enabled = True
End If
End Sub

Good luck, Anne
 
K

Klatuu

The procedure should also be called from the After Update event of the Status
control.
 
Top