Mike Eghtebas
asked on
How to add data to ListBox in VB 6.0
I need code for it.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
List1.AddItem "New Entry"
List1.AddItem "Item1"
ASKER
Maybe I could read it from a backend table, could you please check following code:
Suppose connection to mdb and SQL string are taking care of
.
.
Dim i as integer
if rs.recordcount>0 then
rs.movelast '<-- I need VB version, this is Access code
i=recordcount
rs.move first '<-- I need VB version, this is Access code
Do Until rs.eof
listbox.AddItem(rs("FieldN ame"), i)
rs.movenext '<-- I need VB version, this is Access code
Loop
end if
.
.
Thanks,
Mike
Suppose connection to mdb and SQL string are taking care of
.
.
Dim i as integer
if rs.recordcount>0 then
rs.movelast '<-- I need VB version, this is Access code
i=recordcount
rs.move first '<-- I need VB version, this is Access code
Do Until rs.eof
listbox.AddItem(rs("FieldN
rs.movenext '<-- I need VB version, this is Access code
Loop
end if
.
.
Thanks,
Mike
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if there are errors coming up, make sure you have a reference to adodb
i.e.
Dim i As Integer
For i = 1 To 10
Listbox1.AddItem "Item " & Cstr(i)
Next i
Hope this helps.