List Box Rowsource

  • Thread starter Thread starter doop
  • Start date Start date
D

doop

Guest
I'm trying to write code to display values from an array into a
3 colunm listbox.
I have the set the Rowsourcetype="Value List"

I have problem building a delimted string, any suggestions
 
VB6 offers the Join function which will do this easily, but it is missing from VBA (unless it's been added to more recent versions).

If you don't have it try this replacement...

Public Function Join(ByVal SourceArray As Variant, _
Optional ByVal Delimiter As Variant) As String
Dim sJoin As String
Dim vValue As Variant
If IsMissing(Delimiter) Then Delimiter = " "
If Not IsArray(SourceArray) Then Exit Function
For Each vValue In SourceArray
sJoin = sJoin & vValue & Delimiter
Next
sJoin = Left$(sJoin, Len(sJoin) - Len(Delimiter))
Join = sJoin
End Function
 
Last edited:
Try building your list in the QBE frame. They replicate that code in your rowsource property.
 

Users who are viewing this thread

Back
Top Bottom