Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button enabling 1

Status
Not open for further replies.

Emblem1

Technical User
Jan 11, 2007
77
US
I am trying to enable/disable a radio button based on a combo box selection (cboLocationType). The radio button is called Option New calulation. Not sure how the code should go, here is waht I have:

Private Sub cboLocationType_AfterUpdate()

Me!cboLocation = Null

If Me!cboLocationType = "Signalized Intersection" Then
Me!cboLocation.RowSource = "Intersection Data Query"
Me!OptionNewCalculation.Enabled = Yes
ElseIf Me!cboLocationType = "Time Controlled Warning Flasher" Then
Me!cboLocation.RowSource = "qryTimeUnits_Names"
Me!OptionNewCalculation.Enabled = No
Else
Me!cboLocation.RowSource = "qrySigns&FlashersNameFiltered"
Me!OptionNewCalculation.Enabled = No
End If
End Sub

At first I was using quote around the Yes/No, but I got a mismatch error. Removing the quotes stopped the error, but the code doesn't actually do anything to turn the button on or off. I have the button properties set to Enabled - Yes, which by default is what I want when the form is opened. Signalized Intersection is the default location type on form open also.

Thanks.
 
Actually it is partly working. If I select anything in the combo box other than signalized intersection, it does disable the button. However re-selecting "signalized intersection" doesn't re-enable the button again.

Do I have to recode this as a Case Select?

If so how?


Thanks.
 
try using true/false without quotes.

Me!OptionNewCalculation.Enabled = true
Me!OptionNewCalculation.Enabled = false
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top