I am in need of assistance on an error that I'm getting. I have created a form that when load goes and read an excel spreadsheet and populate a combo box. If the user clicks on the combo box, it will populate the text box base on the specified selection.
The error that I'm getting is "Run-time error '381': Invalid property array index." This error will only occur if I select the first selection from the combo box. Anything else seems excluding the first selection from the combo box seems to work fine.
Below is my code:
rsData.Open "Select * From MODES", conn, adOpenDynamic, adLockOptimistic
Do Until rsData.EOF
If Not IsNull(rsData.Fields(0)) Then
cboModes1.ItemData(rsData.AbsolutePosition - 1) = rsData.AbsolutePosition
Private Sub cboModes1_Click()
rsData.Move cboModes1.ItemData(cboModes1.ListIndex - 1) -------------------------> Here is where i get the error if I select the first selection from the list.
txtModes1.text = rsData.Fields(1)