I have a list box getting a filtered recordset from a stored procedure using ADO calling in VB6.
The recordset returns the two records with correct values. The problem is it is not displaying in the list box. Why? I tried using .additem property but it is not available in Access 2000. Can anyone help me with this? Thanks!
Dim rs_get_defect_desc As New ADODB.Recordset, lot_n as integer
Set lot_n = 4051
Rs_get_defect_desc.Open "EXEC spGet_desc_defect @lot_n=" & lot_n, CurrentProject.Connection
Do While Not rs_get_defect_desc.EOF
Here are the properties for lstbox in Access:
Control source: blank
Row Source: blank
Column count: 2
Bound Column: 1
I need to send in a parameter(lot_n) to the stored procedure as the criteria for the recordset. In VB6 I called sp and the correct number of records returned and so are the fields. I walked through the loop the values in lstbox.rowsource. But they are Not displaying in the list box. Itll work if the Select statement is in Row Source property but I need to pass in parameter for the criteria so I need to write in VB. I also tried assigning Select statement to the rowsouce.