A
Ashley
Can someone please explain to me why the below code produces
Run-Time Error '7777': You have used the ListIndex property
incorrectly.
The error occurs on the second last line of the code?
(Me.Combo2.ListIndex = 0)
Setting the listIndex to 0 for the first combo box works fine.
The two combo boxes are identicle, and the stored procedure is the
same for both combo boxes. This doesn't seem to make sense to me.
I have also tried using a value list as the source of the combo boxes
rather than a stored procedure, but still get the error message as
soon as I try to set the listIndex of the second combo box.
This is an MS Access 2002 project linking to SQL Server 2000.
----------------------------------------------------------------
Option Compare Database
Private Sub Form_Load()
Me.Combo1.RowSource = "EXEC spGetSourceSupplierList"
Me.Combo1.SetFocus
Me.Combo1.ListIndex = 0
End Sub
Public Sub Combo1_AfterUpdate()
Me.Combo2.RowSource = "EXEC spGetSourceSupplierList"
Me.Combo2.SetFocus
Me.Combo2.ListIndex = 0
End Sub
Run-Time Error '7777': You have used the ListIndex property
incorrectly.
The error occurs on the second last line of the code?
(Me.Combo2.ListIndex = 0)
Setting the listIndex to 0 for the first combo box works fine.
The two combo boxes are identicle, and the stored procedure is the
same for both combo boxes. This doesn't seem to make sense to me.
I have also tried using a value list as the source of the combo boxes
rather than a stored procedure, but still get the error message as
soon as I try to set the listIndex of the second combo box.
This is an MS Access 2002 project linking to SQL Server 2000.
----------------------------------------------------------------
Option Compare Database
Private Sub Form_Load()
Me.Combo1.RowSource = "EXEC spGetSourceSupplierList"
Me.Combo1.SetFocus
Me.Combo1.ListIndex = 0
End Sub
Public Sub Combo1_AfterUpdate()
Me.Combo2.RowSource = "EXEC spGetSourceSupplierList"
Me.Combo2.SetFocus
Me.Combo2.ListIndex = 0
End Sub