Update combo without closing form

  • Thread starter Thread starter smcfadden2
  • Start date Start date
S

smcfadden2

Guest
Good afternoon or evening to you in the UK

I have a form for inputting products into a table called "products". On this form is a combo box which lists the Suppliers. This list is generated by a Table called "suppliers".

If the supplier has not alredy been entered into the supplier table then it is not listed in the combo box list. I have added a button to open a supplier entry form to add the supplier to the supplier table. Once the new supplier is entered and the supplier entry form closed, the new entry does not show in the combo box list unless you close the product form and reopen it.

How do I refresh the combo box list without closing the form it is in and reopening it.

Thank you.
 
forms!myMainForm!mycboBox.requery


:)
Ken
 
Thanks Ken, happy b'day.
I use access allot, but at a low level. Where do I put this? In the suppliers entry form "onclose" or in the products form event area?

Shawn
 
Txs,

I would put it first thing in the close button for the supplier entry form.

Ken
 
This only works if you have the main form open. What happens if you need to enter new records in the other table? Once the records are added and you exit the form, you'll bomb out if the main form isn't open.
 
a low-tech way would be to add a "refresh" button to the form in question and just click that to refresh when needed. Not really what I'd do, but is quick and easy to implement.
 
Another low-tech way you could try is Me.refresh in the AfterUpdate Event of the combo.

If I may suggest, why not add the new data using the NotInList method? It's a good way to do it and saves opening that other form each time you want to add data.
 

Users who are viewing this thread

Back
Top Bottom