I have a button on the Main form which is disabled, a subform with a combobox which has 3 columns, 1. ID, 2.Name and 3.Vaild (is a check box).
Now that button on the main form should change to enabled if the combobox colum(3) = True, and this works fine but the problem is if the subform contains more than one record. Every record will have that combobox.
The VBA code which I use
I suppose this code only checks the first record of the subform?
However, I need the button to be enabled if one or more records of the subform have the combobox.column(2) = True
Thanks
Now that button on the main form should change to enabled if the combobox colum(3) = True, and this works fine but the problem is if the subform contains more than one record. Every record will have that combobox.
The VBA code which I use
Code:
Private Sub Form_Current()
If Me.sbfName.Form!cboComboBox.Column(2) = -1 Then
Me.cmdButton.Enabled = True
Else
Me.cmdButton.Enabled = False
End If
End Sub
I suppose this code only checks the first record of the subform?
However, I need the button to be enabled if one or more records of the subform have the combobox.column(2) = True
Thanks