Form update

M

Martin

In Access 2003 I have created a form with a number of fields. Some of
these fields limit the input by providing a drop down list which has
been created from fields in other tables and only items available in the
drop down are permissable. If a user is using the the
form and finds that a particular item is not available to them in the
drop down list I have created a button which, by way of a macro,
automatically opens another form to allow them to put in the information
that's missing.The form opens in 'add' mode only. For example I have
field called 'vendor' in my main form that gives a drop down of the all
vendors we use. If a particular vendor is missing the user can click on
the 'add new vendor' button and the 'new vendor' form opens for them to
populate.
Now comes my difficulty. If the user adds just one new vendor and closes
the 'add new vendor' form the new vendor appears in the drop down list
on the main form. However, if they add two or more vendors at a time or
go back into the 'add new vendor' form a second time, these additional
vendors do not appear in the drop down list on the main form. To make
them appear you need to close the main form and re-open it.
Any thoughts as to what is going on and how to correct this. I am a
self-taught novice so hopefully there is a fairly straightforward answer
to this.
 
J

jahoobob via AccessMonster.com

Look at this method by Dev Ashish and see if it will help you. This method
recognizes a name not on the list and asks if the user wants to add it to the
list. No need to open another form to add the info.
 
K

Klatuu

You will need to add a line of code to requery the combo after the add vendor
form closes. When you add items to the underlying table that is the basis
for a combo's row source, the combo doesn't know it because it only runs the
query when the form is opened. To cause it to update the list, requery the
combo.
 

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