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.
 

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