Using Combo Box and Pop Up question

G

gator

I have a combo box on a form. If a value is not listed in the combo box then
the user can double click the control and a different form pops up to add the
new value. But, when a new value is entered and the pop up form is closed
and the combo box is selected to click on the new value...it isn't there.
What do I need to used to update, refresh, ....the combo box values?
 
D

Dirk Goldgar

gator said:
I have a combo box on a form. If a value is not listed in the combo box
then
the user can double click the control and a different form pops up to add
the
new value. But, when a new value is entered and the pop up form is closed
and the combo box is selected to click on the new value...it isn't there.
What do I need to used to update, refresh, ....the combo box values?


You can either have the popup form requery the combo box in it's close event
....

' This code would be in the popup form.

Private Sub Form_Close()

Forms!YourFormWithCombo!YourCombo.Requery

End Sub

.... *or* you can open the popup form in dialog mode, and have the procedure
that opens it requery the combo box afterward:

' This code would be in the original form.

Private Sub YourCombo_DblClick(Cancel As Integer)

DoCmd.OpenForm YourPopupForm, WindowMode:=acDialog

Me.YourCombo.Requery

End Sub

As you see, you can take either approach.
 

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