Combobox Based on Recordset..

A

anandkhinvasara

I am using an combobox based on a recordset (adOpenDynamic,
adLockBatchOptimistic) and populating it on FORM LOAD

Set cboName.Recordset = rsTemp

I make an entry to the table on which this recordset is based through
SQL Statement.
After this I requery my combobox

cboName.Requery

But I do not see the newly added record here. I have to close the form
and reopen it again to see the new record.

I have also tried requerying the recordset on which the combobox is
based, before requering the combobox..But didn't work ? Please advise
on this.
 
A

anandkhinvasara

Thanks Klatuu,

I tried that. But it didn't work.

The temporary solution I found out is setting the combobox's recordset
everytime with a new recordset, wherever I have to requery.

But its not a good method and very resource heavy too.

Anybody's got a better solution than this ?

Regards,
Anand
 
D

dragos

I am using an combobox based on a recordset (adOpenDynamic,
adLockBatchOptimistic) and populating it on FORM LOAD

Set cboName.Recordset = rsTemp

I make an entry to the table on which this recordset is based through
SQL Statement.
After this I requery my combobox

cboName.Requery

But I do not see the newly added record here. I have to close the form
and reopen it again to see the new record.

I have also tried requerying the recordset on which the combobox is
based, before requering the combobox..But didn't work ? Please advise
on this.


The sufficient and required method to get new data is to requery your
combo box. This for sure will get the new data but you must pay
attention on the time when it acts.
1. For example put a timer event on your form and requery your combo
from there. Set the timer somewhere under 30000 (30 seconds). You'll
see the new added records in your combobox.
2. Make a simple command button which requery the combo box. When you
press the button the combobix will contain all the records you want

Dragos
 

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