0

Can anyone tell me why i am getting error object invalid or no longer set.here is the code what i have written.any help would
be greately appreciated.

Private Sub FillVendorList()
 Dim rs As New ADODB.Recordset, sqlQuery As String, i As Integer
 sqlQuery = "Select Suppliers.sup_id,Suppliers.Sup_name from Suppliers order by Suppliers.sup_name"
' Set rs = New ADODB.Recordset
 Set rs = New ADODB.Recordset
' rs.Open sqlQuery, con, adOpenDynamic, adLockOptimistic
 rs.Open sqlQuery, con, adOpenDynamic, adLockOptimistic
 If Not (rs.EOF And rs.BOF) Then
 rs.MoveFirst
 Do Until rs.EOF
 Combo2.List(i) = rs!sup_name & ""
 Combo2.ItemData(i) = rs!sup_id
   i = i + 1
   rs.MoveNext
   Loop
   End If
   Combo2.Text = "sugvendor"
   Combo2.ListIndex = -1
   rs.Close
   Set rs = Nothing
   End Sub
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by c0deFr3aK
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.