Populating Listbox (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 09:03
Joined
Oct 30, 2008
Messages
1,257
Stuck a problem with AddItem in my 2 column listbox


Code:
.Additem item:=Dat(1) & ";" & Dat(0)


Found if Dat(1) contains a comma, it's used as field delimiter and fills both columns, without ever seeing Dat(0). How do I put each piece into it's own column ?


I did Google for this and found instructions to set the listbox Rowsource to a query.

Code:
Me.List23.Rowsource = sql$
But that just put the sql into the lists, not the result of the sql.
 

ITguaranteed

New member
Local time
Tomorrow, 07:03
Joined
Jun 21, 2019
Messages
3
Add in quotes around each item.

Code:
.Additem item:="'" & Dat(1) & "';'" & Dat(0) & "'"
 

kirkm

Registered User.
Local time
Tomorrow, 09:03
Joined
Oct 30, 2008
Messages
1,257
Ah, right... thanks for that. I also found Rowsource did work -after changing Row Source Type from Value List to Table/Query
 

Users who are viewing this thread

Top Bottom