I have a form which has several radio buttons with two drop down combo boxes next to each. I am trying to get the combo boxes to be greyed out and not be able to be edited. When the radio button is selected I need the combo boxes next to them to become active and allow users to enter information. Also if they change their mind and disable the radio button the information they had selected in the combo boxes needs to be removed.
I'm a bit new to this and I've managed to get the combo boxes to grey out, but I cannot do the rest. I've tried using the 'Enable = No' and 'Locked = No' commands but I cannot get them to work correctly.
Thanks in advance
Code so far:
Grey out boxes when Radio Button (Option157) is false this bit works OK
Private Sub Option157_AfterUpdate()
If Me!Option157 = True Then Me!Combo138.BackColor = 16777215 Else Me!Combo138.BackColor = 12632256
If Me!Option157 = True Then Me!Combo140.BackColor = 16777215 Else Me!Combo140.BackColor = 12632256
I have tried this also but it does not work correctly
If Me!Option157 = False Then Me!Combo138.Enabled = No Else Me!Combo138.Enabled = Yes
If Me!Option157 = False Then Me!Combo140.Locked = Yes Else Me!Combo140.Locked = No
Why don't you try what I have in one of my databases. I have a CheckBox named "ChangeOfAddress" and the TextBox named "AddressChangeInfo." What happens is the TextBox to input the AddressChangeInfo is set as "Enabled.No". Then, for the CheckBox, on the OnClickevent I did this:
Private Sub ChangeOfAddress_Click()
'Created by BUD 12/11/2003.
'When the ChangeOfAddress box is checked, the AddressChangeInfo section
AddressChangeInfo.Enabled = ChangeOfAddress
That's all there is to it. So when you check the CheckBox the AddressChangeInfo TextBox comes alive (Enabled). The Reverse happens when you UnCheck the CheckBox.