Refresh a combo box

wizcow

Registered User.
Local time
Today, 16:03
Joined
Sep 22, 2001
Messages
236
I want to refresh the list in my "Customers" combo box.
The "Customers" combo box is on my main form.

1.I open the Customer form and add a new customer, with the main form still open.
2.I close the Customer form.
3.When I check the "Customers" combo box I DO NOT find the new customer.

What is the proper procedure to update my combo box?
 
in the on close event of your customer form you enter this: Forms!<nameofform>.Form!<nameofcombobox>.requery
 
Alternatively you could add something similar to the Activate event of your main form. When the Customer form closes, the main form then becomes active and the box will be requeried. I believe the code would be:

requery.COMBO_BOX_NAME_HERE

I've tried the on close event method stated previously, but have encountered problems at times. This method will work whenever the main form becomes active, thus always requering the combo box. That way, if you ever need to open another form to add info (not just the customer form) it will requery it then too.


[This message has been edited by Rakier (edited 04-16-2002).]
 

Users who are viewing this thread

Back
Top Bottom