All
I created a function which fills in a given listbox on a given form. This works as expected
FillInListbox lstMyListbox, frmForm, rs
public sub FillInListbox(lst as ListBox, frm as Form, rs as RecordSet)
while not rs.bof and not rs.eof
frm(lst.name).Additem rs!Data
rs.movenext
wend
end sub
I am now in a situation where I need to fill in a "virtual listbox" so there is no real form nor a real listbox. So I want to assign the values to a listbox I create in the code. Is this possible?
public sub FillInListbox(lst as ListBox, frm as Form, rs as RecordSet)
if lst = nothing then
…
else
while not rs.bof and not rs.eof
frm(lst.name).Additem rs!Data
rs.movenext
wend
end if
end sub