requery a combo box

S

Steve

I have a combo box set up so that if the item I am looking for is not a
member of the recordset I can doubleclick and go to a form to add the item.
The next line of code after "Docmd.openform frmname" is "me.combo0.requery".
Thus, after closing the form, I want to requery the combo, but the item does
not show up when I click on the combo. Is this the wrong place to do a
requery?
 
O

Ofer

Hi Steve

Try and open the form as dialog
docmd.OpenForm "FormName",,,,,acDialog

that will suspend the code from continuing, so it will requery after adding
the record
 
J

John Vinson

C"Steve said:
I have a combo box set up so that if the item I am looking for is not a
member of the recordset I can doubleclick and go to a form to add the item.
The next line of code after "Docmd.openform frmname" is "me.combo0.requery".
Thus, after closing the form, I want to requery the combo, but the item does
not show up when I click on the combo. Is this the wrong place to do a
requery?

Ofer's suggestion is certainly a good one; another technique is to use the
combo's Not In List event. You can set the parameters to automatically
requery the combo on return from the dialog form (or other code). See the
online help for NotInList method.

John W. Vinson/MVP
 
Top