Hiya,
Using VBA, I'm trying to fill a list box with the contents of a recordset. I'm being a thick as it's putting each field from the rset into a new item on this list. How do you put each field into a new column ???
here's wher I am so far (not very! lol).
Any help much appreciated.
Using VBA, I'm trying to fill a list box with the contents of a recordset. I'm being a thick as it's putting each field from the rset into a new item on this list. How do you put each field into a new column ???
Code:
ReDim Arr(1 To rs.Fields.Count - 1)
ReDim Lbox(1 To UserForm6.DisplayBox.ColumnCount - 1)
'use additem & vbtab & item, etc
rs.MoveFirst
For i = LBound(Arr) To UBound(Arr)
If Not IsNull(rs.Fields(i)) Then
UserForm6.DisplayBox.AddItem rs.Fields(i).Value
End If
rs.MoveNext
Next i
Any help much appreciated.