disable button based on value

  • Thread starter Thread starter Steven Brookes
  • Start date Start date
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.
 
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
 
Back
Top