Listbox and Recordset

  • Thread starter Thread starter dave h
  • Start date Start date
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.
 
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
 
Back
Top