Refreshing a combo box in an open form

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
 
B

Brian Bastl

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top