Combobox Based on Recordset..

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