Updated Combo Box

petehk

Registered User.
Local time
Today, 23:08
Joined
Oct 28, 2004
Messages
19
Hi again. Another easy solution for you to point out for me. Have a main form that has combo boxes listing suppliers, originators etc. All combo boxes have a relevant button which enable the user to enter another form and add new suppliers, originators etc. However when the form is closed the new data is not supplied in the combo boxes unless i close the main form and reopen it. Is there an update command that i can run to add the new data to the combo boxes when i close the smaller forms?
 
if you use the form activate procedure, and in there put some code to refresh your combo boxes, then that should work.

So when the user comes back in the form it should refresh the supplier list, due to them adding a new one.

Hope this helps.
 
Any ideas on possible code? VB is not my strongest suit.
 
Try pasting the code below in After_Update Combo Box
Me!ComboBoxRequery.Requery

hth,

Michael
 
Have done as suggested but there still seems to be no change. A button launches a new form, for example originator, allowing the user to add more data. This is then to come up in the combo box on the main form, but the new originator is not on the list. However if i close the main form adn then reopen it, the new originator is in the combo box. Hope i am explaining this ok, and hope someone can help. It's now the one finishing touch that i need for my system :confused:
 
You can try to put Me!ComboBoxRequery.Requery on On Close Event of another form that you open to update your data.
 
Wild Horse said:
You can try to put Me!ComboBoxRequery.Requery on On Close Event of another form that you open to update your data.

Firstly, use Me. and not Me! in this instance.

Secondly, you shouldn't have to put code in the popup form's Close event as you simply have to open the popup form as a Dialog - this suspends the running of all other code after the OpenForm method until the dialog form is closed.

Thirdly, have a look at the Adding a new entry to a combobox FAQ I wrote using the NotInList event. It is easily customisable to include a data entry form. I've even done examples (somwhere in the archive) that demonstrate exactly what you want.
 

Users who are viewing this thread

Back
Top Bottom