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
 

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

Similar Threads

Combo box 0
Combo Box is not requerying 2
Requery Combo boxes 5
Requery combo box 4
Combo box issue 7
Combo Box contents should have changed 2
Form Event 2
Count Results in Access 97 8

Top