Graham T
11-27-2001, 05:50 AM
I would like to set the values of various controls to N/A if the value chosen in an option group is set to No.
I can do this using the following code for setting the value of one combo box and would like to know if other controls can be added to the one line of code:
Private Sub grpOptions_AfterUpdate()
If (Me!grpOptions = 2) Then 'Option 2 = "No"
Me!cboAltHome2ID = 5 'Value 5 = "N/A" in the table.
Else
Me!cboAltHome2ID = "" 'If option group value = 1 or Yes_
'then value of combo box is left blank.
End If
End Sub
[This message has been edited by Graham T (edited 11-27-2001).]
I can do this using the following code for setting the value of one combo box and would like to know if other controls can be added to the one line of code:
Private Sub grpOptions_AfterUpdate()
If (Me!grpOptions = 2) Then 'Option 2 = "No"
Me!cboAltHome2ID = 5 'Value 5 = "N/A" in the table.
Else
Me!cboAltHome2ID = "" 'If option group value = 1 or Yes_
'then value of combo box is left blank.
End If
End Sub
[This message has been edited by Graham T (edited 11-27-2001).]