Updating

J

John T.

I have a form with a combo box called Color. I also have
a button next to it called Add Color. If a color is not
in the combo box, I press the Add Color button and it
takes me to the Add Color form. When I finish adding the
new color I have a button called Done. When I press that
it closes the Add Color form and returns me to the
original form. The Done button has an event programmed
for the On Click event that does a save (DoCmd.Save). The
problem I have is when I return to the original form, the
new colors aren't there. I have to close the form and
open it again to get the new colors to appear. Is there a
way to have this combo box update so the new colors
appear without having to close and open the form?

Thanks.
John
 
R

Rick Brandt

John T. said:
I have a form with a combo box called Color. I also have
a button next to it called Add Color. If a color is not
in the combo box, I press the Add Color button and it
takes me to the Add Color form. When I finish adding the
new color I have a button called Done. When I press that
it closes the Add Color form and returns me to the
original form. The Done button has an event programmed
for the On Click event that does a save (DoCmd.Save). The
problem I have is when I return to the original form, the
new colors aren't there. I have to close the form and
open it again to get the new colors to appear. Is there a
way to have this combo box update so the new colors
appear without having to close and open the form?

The DoCmd.Save is accomplishing nothing for you. Replace it with...

Me.Dirty = False
Forms!NameOfFirstForm!NameOfComboBox.Requery
 

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