Hi,
I am using this part of the code to get data written in listbox, both 1st and 2nd column. Data is populated after button is pressed on form.
Do you have an idea why in listbox 2nd column is not populated, but if I do Debug.Print for 2nd column, I see the data:
Debug Code would we Debug.Print .lstSCL.List(i,1)
How to fix this?
I am using this part of the code to get data written in listbox, both 1st and 2nd column. Data is populated after button is pressed on form.
Do you have an idea why in listbox 2nd column is not populated, but if I do Debug.Print for 2nd column, I see the data:
Code:
With Me
Dim i As Integer
i = 0
For Each row In rows
' Check if the row is not empty
If Trim(row) <> "" Then
strSQL = "SELECT tbMaterials.[Description] FROM tbMaterials WHERE tbMaterials.[Material] ='" & row & "'"
rs.Open strSQL, conn
' Add the non-empty row to the ListBox
.lstSCL.AddItem row
.lstSCL.List(i, 1) = rs("Description").Value
rs.Close
End If
i = i + 1
Next row
End With
Debug Code would we Debug.Print .lstSCL.List(i,1)
How to fix this?