disable certain fields

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

How can i disable fields if a certain value is selected.

If i select no in a option box field certain fields would be disabled
and if i select yes the fields would be enabled.
should i use another method besides and option box field?

any and all replys would greatly be appreciated.

Greg
 
In the AfterUpdate event handler of the option box, place
code along the following lines

If {youroptionbox} then 'option box has been selected
{yourfield}.Enabled = True
etc
Else
{yourfield}.Enabled = False
etc
End If

Hope That Helps
Gerald Stanley MCSD
 
How can i disable fields if a certain value is selected.

If i select no in a option box field certain fields would be disabled
and if i select yes the fields would be enabled.
should i use another method besides and option box field?

any and all replys would greatly be appreciated.

Greg

You'll need just a little bit of VBA code to do this.

In the AfterUpdate of the option box put code like:

Private Sub Me!optMyOptionBox_AfterUpdate()
Select Case Me!optMyOptionbox
Case 1 ' the "yes" option
Me!thiscontrol.Enabled = True
Me!thatcontrol.Enabled = True
Case 2 ' the "no" option
Me!thiscontrol.Enabled = False
Me!thatcontrol.Enabled = False
Case Else
<do something appropriate>
End Select
End Sub

Put the same code in the Form's current event so that when the user
navigates to a new record the controls are set properly.
 
Back
Top