Requery a Combo from Another Window

S

Scott

I have a [Main Form] that contains a combo control. The combo has a
NotInList event that opens a form so user can enter a new record. My
NotInList event works and opens the form, but I get an error when closing
it.

I need to be able to requery the [Main Form] combo on the close of the
pop-up window.

From the pop-up form, what would the syntax be to requery the combo on the
[Main Form]?

I tried the below, but it didn't work.

Forms!fmyMainForm!myCombo.Requery
 
D

Douglas J. Steele

If you're opening the popup as a modal form, just put the requery in the
NotInList event: it won't work until the popup is closed.

If that doesn't work, post your NotInList code.
 
K

Ken Snell \(MVP\)

Define "didn't work". My guess is that your second form is requerying the
combo box before it has saved the newly entered data to the table, so the
combo box doesn't "see" the new data yet.

Put the Requery action in the code that opens the second form (be sure that
you open the second form in dialog mode so that the code "pauses" until the
second form is closed).
 

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