A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combobox Based on Recordset..



 
 
Thread Tools Display Modes
  #1  
Old December 21st, 2006, 11:20 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 2
Default Combobox Based on Recordset..

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.

  #2  
Old December 21st, 2006, 02:01 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Combobox Based on Recordset..

If you are adding new records through the form, you have to requery the form.

" wrote:

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.


  #3  
Old December 26th, 2006, 05:58 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 2
Default Combobox Based on Recordset..


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

  #5  
Old December 27th, 2006, 02:04 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Combobox Based on Recordset..

I don't believe I read your original post correctly. First this is, a combo
box has no recordset. It does have a row source.

This line
Set cboName.Recordset = rsTemp
Is not correct. It should be
Me.cboName.RowSource = ???
It would not be the name of an open recordset, but either an SQL statement
or stored query that retrieves the data you need.

" wrote:


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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.