Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh data in a combobox

Status
Not open for further replies.
Mar 27, 2002
168
NL
ON a combobox I write code to open the item and update the data.
for example:
I have a cbo with info from locations
I want to have the possibility to change the names
so I have a change form with an update query.
the problem is: the data will be updated but not refreshed so the user can't see immediately the changes are made
Ill tried to requery the cbo after update the info, but it doesn't work.
Anybody a good idea?
Thnx
Gerard
 

Hi Gerard

Do you source your combo directly from the table?

If that is the case create a query to source your combo box and then requery

If this is not the case could you supply info as to whether you are using code for anything & how the combo is sourced

regards jo
 
Thnx for ur quick reply Joanne,
the problem is not the source of the combo.
I also have a delete string when the location is deleted at all
this: forms!frmWerkbon!Location.requery do the right thing at that moment
but with the update string the same line doesn't give any reaction.
I think the data is not refreshed quick enough in the table or something
maybe there's a difference between delete a record and change a record.
If u know, I know ;)
any other suggestions?

Gerard
 

I think the data is not refreshed quick enough in the table or something......

The reason I asked about the source was I had the same problem but if..
while the form was minimized ( or even moved to one side)
I clicked queries /reports in the database window (F11)and then clicked back to tables (refreshing the collection)
then maximised my form the data was there

the act of requerying a query has the same effect

regards

Jo

 
Hi Gerard,

Try this.. in update sub...

cboLocation.rowsource=&quot;select * from <table>&quot;

best

Shyam


 
Ur idea was good, I believed u before I tried, but ;-) it's not working, sorry

Good try, thanx

Gerard
I look further
 
Usually these thing are sorted out by using

me.requery

as suggested by others

in the past I have had to add a

me.refresh

to get the info properly updated but you may need to code a reload of the form to get a full refresh

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top