Refreshing combo box

eacollie

Registered User.
Local time
Today, 04:22
Joined
May 14, 2011
Messages
159
I have two forms:
(1) List of names
(2) List of events

A person is added to an event on form2 using a combo box with a row source being a select statement from the table of people.

When the user wants to add a person to an event, and that person does not yet exist in the table of people, the user can open form1 linked to the table of people and add this name.

My question: Which event is used to update the combo box on form2 to now display this newly added person?

I've tried to requery the combo box in the events: before update, not in list but doesn't work.
Thanks so much!
 
I would normally do this kind of thing in the Not In List event of the combo box. If the data being added to the Names table is a single piece of data, like "Tom" or "Harry", then this can be done without even opening the Names form. If the data to be added is more detailed, like Tom as first name and Smith as surname then I would open the names form as a Dialog, using the Not In List event of the combo box.
 
Thanks Bob.
The user knows that if the person is not in the dropdown list to open up form1 and add the name. The second form (with the combo box) remains open. I'm looking for the event that will refresh/requery the combo box on the second form.
 
If the names form is opened as a dialog, code execution will stop at that point until the names form is closed. So, the code to open the names form runs in the events form you would just need something like:
Me.NameOfComboBox.Requery
after the line that opens the names form.
 
So, if the names form (form1) is already open, it will shift focus to it?

I add the refresh/requery of the combo box on form2 to the close event of form1 (after determining if form2 is open)?
 
So, if the names form (form1) is already open, it will shift focus to it?

I add the refresh/requery of the combo box on form2 to the close event of form1 (after determining if form2 is open)?
I think that should work. Try it out and let us know.
 
Not sure if this direction will work. My form2 has a combo box for a name and then a combo box for a room assignment, and both values are required. When the user clicks on the "name" combo box and doesn't find the name wanted (and therefore it has to be added to the name table using the name form -- form1), it won't allow the record to be saved on form2 because all the required data has not yet been added.
 
Not sure if this direction will work.
Then perhaps you would like to try using the Not In List event of the combo box which I suggested in my first post of this thread.
 
Thank you so much Bob. I'm going to find out how the user (there's one that primarily does this step in the process) would approach this and then try to design something around that. I've learned that how I approach a process may be very different than the way a user may. I'll let you know.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom