Hi All,
I've done some searching but could not find an answer for this.
In my userform there are a couple of textboxes, a combobox, 12 checkboxes and a listbox populated with a table. I would like all of the boxes to populate when I select a line in the listbox. Using the click event, I can populate the text and comboboxes without issue, but when I try an if statement to decide whether or not to check my first checkbox I get an object required error on the first line of my if statement.
Here is my code so far:
Any advice you guys can give would be very much appreciated.
Many thanks in advance,
Dave
I've done some searching but could not find an answer for this.
In my userform there are a couple of textboxes, a combobox, 12 checkboxes and a listbox populated with a table. I would like all of the boxes to populate when I select a line in the listbox. Using the click event, I can populate the text and comboboxes without issue, but when I try an if statement to decide whether or not to check my first checkbox I get an object required error on the first line of my if statement.
Here is my code so far:
VBA Code:
Private Sub ConsultantList_Click()
Consultant.Value = ConsultantList.Column(0)
Specialty.Value = ConsultantList.Column(1)
Hospital.Value = ConsultantList.Column(2)
If ConsultantList.Column(4).Value = "Yes" Then 'error occurs here on ConsultantList.Column(4).Value
CheckBox1.Value = True
Else
CheckBox1.Value = False
End If
End Sub
Any advice you guys can give would be very much appreciated.
Many thanks in advance,
Dave