Update Table via Combobox

bgangelmayer

New member
Local time
Today, 15:38
Joined
Mar 18, 2013
Messages
7
Hello Everyone :)

I have issues to get the following working.

I have a form with a Combobox that gets it's data from the table 'countries' and stores information in accounts.

Now I would need data entered in the cobobox to be checked against the table 'countries' if the data already exists...

if a.) yes - then all good
if b.) no - then new entry should be added to table and combobox (after confirmation)

Would be great if someone could help me out with this one or point me in the right direction as I am fairly new with access

much appreciated
 
Hello bgangelmayer, Welcome to AWF.. :)

Well you can create a Form that will be based on the table Countries, That will allow you to Edit the values/Add new values.. Then in the ComboBox property sheet look for Allow List Edits.. Then choose the form you created for the countries as the Form that will allow list edits.. So when you use the drop down it will come up with an icon for Editing the Combo.. If you click it, it will bring up the form to add new entry, once you close it, the value will be in the combo..

Hope this helps..
 
Hello, Thank you very much for the fast response.

I probably was not quite exact when describing my problem.

I have to tables, accounts and countries.

The form is based on accounts (basically a customer database) and contains a combo box that gets it's data from the table countries.

What I would like to do now, is add new entries to the table country 'on the fly' by typing in data in the combo box. If it exists already, just use the information, if not, double check with user to confirm that a new entry should be added and then add the entry to the table countries and the combo box .

Any suggestions are welcome.

this is more a basic problem I encountered as I would like to use the solution on other fields as well.
 
yes that works great - there wouldn't be a way around using a second form to enter the data ?

like in this way - you enter data not in the table/cboBox - a popup msg appears asking to confirm if you want to enter new value - value is added to table upon confirmation & cboBox updates :)
 
Check this sample. Compare it with the previous sample and you should see they work in a very similar manner.
 

Attachments

Thank you John, you are great.

Works nicely and I learned a lot by going through the example.

Much appreciated :)

*****

After digging a little more I found this: .allenbrowne.com/ser-27-01.html

which is an excellent solution too
 
Last edited:

Users who are viewing this thread

Back
Top Bottom