disable a button based on combo box value

  • Thread starter Thread starter firecop1
  • Start date Start date
F

firecop1

Hi all
I am looking to disable a button called "permits" if "none required" is the
selected choice in a combo box.

Can anyone walk me through this (I am a non programmer so go easy on me LOL)

Thanks
Andy
 
Andy,

Assuming the name of the combo box is MyCombo, you will need to put the
following code:

If Me.MyCombo = "none required" Then
Me.Permits.Enabled = True
Else
Me.Permits.Enabled = False
End If

in the combo's On Change event. Also, it would probably make sense to
put the same code in the form's On Current event so it enables/disables
the button as you browse through records. Make sure you use the actual
combo name instead of MyCombo in the example above!

HTH,
Nikos
 
Thanks Nikos
worked like a charm!!!!!

Nikos Yannacopoulos said:
Andy,

Assuming the name of the combo box is MyCombo, you will need to put the
following code:

If Me.MyCombo = "none required" Then
Me.Permits.Enabled = True
Else
Me.Permits.Enabled = False
End If

in the combo's On Change event. Also, it would probably make sense to put
the same code in the form's On Current event so it enables/disables the
button as you browse through records. Make sure you use the actual combo
name instead of MyCombo in the example above!

HTH,
Nikos
 
Back
Top