Refreshing a combo box in an open form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a quick question concerning combo boxes in forms and how to get them
to update when changes are made to the underlying table. I have a main form
that is pulling from a table. In the table there is a field called
"supplier" that is a combo box that feeds off another table called "t
supplier". On the main form i have the option to open up t supplier and add
a name if the name isnt already in the t supplier table. The problem is when
I add a supplier name, the recently added name does not appear in the combo
box on the main form until i close the form completely. I have tried
attaching a requery macro to upon click in the combo box, but for some reason
that does not work. This seems like a pretty simple problem, but I cannot
figure it out. If anyone can offer some guidance i would really appreciate
it.

Thanks
 
justin,

use the combo's NotInList() procedure and set its Limit To List property to
yes. Once the new value has been added to the table, set the Response =
acDataErrAdded. That one line will requery the combobox.

HTH,
Brian
 
Brian,

Thanks for the quick response. I have a follow up question for you
concerning setting the response to acDataErrAdded. Could you explain this in
a little more detail. How exactly do i set he response? It is probably
pretty simple, but I am just learning how to work with forms.

Thanks again.
 
Back
Top