Error trying to update unbound multi-select list box

E

Eric Heinold

I have a form that has several unbound list boxes that I update in a
function. This function is called during the Current event mainly.

In the function, I use an ADO recordset to determine which lines in each
list box should be selected. Currently, I use 1 recordset, get the values
for one listbox, close the recordset, then open it again to determine
selected for the next list box.

The problem I am having is that when I try to reuse the recordset, the
second time I try to open it, I get error number 3265 "Item cannot be found
in the collection corresponding to the requested name or ordinal."

The SQL is correct. For testing I tried moving the code above the first
section used to fill a different list box, and the one that was previously
the second to be filled was filled correctly, but then the previous first
one gave an error.

If I use a different recordset for each list box, they all work correctly,
but I hate to use that solution, since it is creating multiple needless
recordset variables

The recordset is always closed after I am done filling the previous section
To debug, I tried setting the recordset to nothing, and then reinitializing
it, but that didn't seem to help either.

If I use DAO instead of ADO, the code works fine, but currently, the project
I am working on is needs to use ADO.

Thanks,

Eric
 

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