Listbox and Recordset

D

dave h

Hi,

I've been using myListBox.rowsource = mySQL and this works well. Now I'd
like to assign a recordset to the listbox instead.

I've tried "myListBox.recordset = myRS " and " Set myListBoxSet.recordset =
myRS". The first version gives a runtime error and the second version does
not produce any results. I can see by using "debug.print" that the RS has
valid values.

What am I doing wrong? Thanks.
 
D

dave h

I've found that the major difference between the rowsource and recordset is
the fact that the listbox retains the data after the rowsource assignment,
but the listbox loses the data from a recordset assignment as soon as the DB
is closed. I always assumed one should close the DB after any recordset
operation was completed. Should I leave the DB open? I have no other
reason to keep it open at this point. Is there a way to move the data to a
RS that does not require and open DB?

Thanks DaveH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top