Add/Edit combo box question

T

timl

I've got a couple combo box fields in a subform set up to open pop-up
forms on double-click as a way of adding new items to those lists.
When I open the pop-up, add a new item, then close the pop-up form, the
new item is not available in the combo box list.

The row/source type for the combo fields is set to Table/Query and the
row sources are queries of, respectively, a parts list and list of
service types.

I want to get the combo box list to automatically update and show any
new items added through the pop-up form. How can I make this work?
 
R

Ruel via AccessMonster.com

Do a OnClose Event Procedure on the pop-up form that will requery the
ComboBox on the main form.

Ruel
 
T

timl

Thanks. I set up a macro in OnClose of the popup however it doesn't
seem to update the combo box (or the table that underlies it) when the
popup form is closed. Does it matter at all that the combo box is in a
subform? In order to get additions or deletions made via the popup to
take effect in the combo box list I have to close the main form and
reopen it.

thanks, T
 
R

Ruel Cespedes via AccessMonster.com

No Macro's. Please use VBA. Create an OnClose Event Procedure like this:

Private Sub Form_Close()

Forms![MainFormName]![SubformName].Form![ComboBoxName].Requery

End Sub


* = Special Instructions

*MainFormName = Replace with your Main Form Name
*SubformName = Replace with your Subform Name
*ComboBoxName = Replace with your Combo Box Name

Ruel
 

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