Reload a ComboBox

samuvk

Registered User.
Local time
Today, 13:16
Joined
Mar 3, 2010
Messages
24
I have a form, where I can introduce a new data in a table.

Let say: Table1, Fields: Name

So I introduce a Name in a the field Name: Jhon

So now, Jhon is in the database

in the same form I have a combobox with all the names existing in the database.

When I introduce the new name in a textbox, I need to automatically introduce the new name in the combobox.

Anyone can help how can I do it.

Thank you very much
 
In the after update of the text box:

Me.YourComboName.Requery
 
One way to do that would be to do:

Code:
Me.MyComboBox.Requery

Substitute the "MyComboBox" with the actual name of your combobox, and run this on a form's event (AfterUpdate event, perchance?). This should give you the newest entry without requerying the form itself. (Note that requerying the form should requery the combobox as well but that would be overkill and unnecessary if you've already getting the new record displayed in your form.)
 

Users who are viewing this thread

Back
Top Bottom