Update values in a combo box after updating record

  • Thread starter Thread starter kswinth
  • Start date Start date
K

kswinth

Guest
I'm sure there is an easy solution to this one, but I have a terrible time passing data from one table/query/form to another, so I'm hoping someone can help me out.

Currently, I have a form (called GroupReservations) with a combobox that list the first name, last name, and agency that someone is from. The first column is bound to AgentID and the combobox pulls from a query called [Contacts & Agents] (Agency name comes from the agents table and first and last name come from the contacts table). That info then fills in a bunch of other fields in my form -- which is all working fine.

Now, I want to allow users to add new agents or contacts if the agency or person they are looking for is not on the list, so I created a command button called NewAgent that opens up a form called "Maintain Agent List".

When users click the button, the other form opens and allows them to enter a new contact and/or agency. So far so good.

Here's the problem... How do I let my combobox know that it needs to requery (I guess) the "Contacts & Agents" query so that the new record shows on the list? If I close my form and reopen it, the new info is on the list in the combobox. But I can't get it to update automatically upon entering the record in the "Maintain Agent List" form.

Any assistance would be appreciated!

Kim
 
Still a little lost

Hi Michael,

Thanks for your quick response! I'm still a little confused, though.

The form that I'm opening and using to update the underlying tables/queries is not a subform. So I'm having a hard time applying what was in the link you posted to my situation. I open the other form so that I can input data into it, but I'm not sure how I should reference that.

Do I need something in the external form that I've updated or just on the main form that holds that combobox I want to update? I tried doing a requery when the main form regains focus or OnCurrent. But that didn't seem to work.

Kim
 
Got it working :)

Hi Michael -- Disregard my last posting. I played around with this some more and got it working. Thanks for your help!
 
KSWINTH,
I have the same situation that you had...... could you possibly enlighten me on how you solved your problem. Any help would be greatly appreciated.

dmeid
 
I'd love to know how you figured this out also........ :o
 

Users who are viewing this thread

Back
Top Bottom