I have created a combo box that is set to a stored procedure that is a select statements. I have set it to the stored procedure in the property sheet.
I also have a text box and when the use selects something from the list box, I would like my combo box to default to a particular value. Here is the function I used to do so:
Public Sub SetCboBox_Value(cbo As ComboBox, val As Variant)
Dim i As Long
For i = 0 To cbo.ListCount - 1
If cbo.Column(1, i) = val Then
cbo = cbo.Column(0, i)
GoTo FUNCT_EXIT
End If
Next i
FUNCT_EXIT:
End Sub
QUESTION IS I GET THE 2115 Error on the cbo = cbo.column(0,i). Any solutions? I have nothing on beforeupdate or any validation rules. I am confused. Thanks
I also have a text box and when the use selects something from the list box, I would like my combo box to default to a particular value. Here is the function I used to do so:
Public Sub SetCboBox_Value(cbo As ComboBox, val As Variant)
Dim i As Long
For i = 0 To cbo.ListCount - 1
If cbo.Column(1, i) = val Then
cbo = cbo.Column(0, i)
GoTo FUNCT_EXIT
End If
Next i
FUNCT_EXIT:
End Sub
QUESTION IS I GET THE 2115 Error on the cbo = cbo.column(0,i). Any solutions? I have nothing on beforeupdate or any validation rules. I am confused. Thanks