D
darrep
I have two combo boxes on a form. Their intent is to allow a user to select
a record on the form by choosing a value in either combo box.
I have written code to automatically update one combo box when the other is
changed. Here is the code:
If cboReportNum <> "" Then
If cboReportNum.ListIndex <> cboReportName.ListIndex Then
index = cboReportNum.ListIndex
cboReportName.SetFocus
cboReportName.ListIndex = index
End If
End If
The code attached to the other combo box (cboReportName) is exactly the same
with the names switched appropriately and works to update as planned, but the
above code gives me a "You have used the ListIndex Property Incorrectly"
error.
Also, the exact same code on a different form works properly both ways.
Any ideas why this is not behaving properly?
a record on the form by choosing a value in either combo box.
I have written code to automatically update one combo box when the other is
changed. Here is the code:
If cboReportNum <> "" Then
If cboReportNum.ListIndex <> cboReportName.ListIndex Then
index = cboReportNum.ListIndex
cboReportName.SetFocus
cboReportName.ListIndex = index
End If
End If
The code attached to the other combo box (cboReportName) is exactly the same
with the names switched appropriately and works to update as planned, but the
above code gives me a "You have used the ListIndex Property Incorrectly"
error.
Also, the exact same code on a different form works properly both ways.
Any ideas why this is not behaving properly?