Adding data to a table using a combo box in a form

P

Pforecast

I just bought ACCESS 2007 and am having a few problems. Here's the one I'm
trying to figure out now.

I have two tables. PRODUCERS & CLIENTINFO. I would like to use the form,
CLIENT INFO TRACKING to add new data to the PRODUCERS table. I've set up
the form so PRODUCERS would be a combo box. I would like to use the combo
box to enter the name of the producers and have it save those names in the
PRODUCERS table. That way I can continue to enter new producers in the combo
box or click on the combo box and have the previously entered producer's
names pop up. I tried cutting and pasting some code from an ACCESS 2003
site, but it keeps giving me error messages like 'the name is not in the
table'. Does this make sense? Can anyone help me out
 
J

John W. Vinson

I have two tables. PRODUCERS & CLIENTINFO. I would like to use the form,
CLIENT INFO TRACKING to add new data to the PRODUCERS table. I've set up
the form so PRODUCERS would be a combo box. I would like to use the combo
box to enter the name of the producers and have it save those names in the
PRODUCERS table. That way I can continue to enter new producers in the combo
box or click on the combo box and have the previously entered producer's
names pop up. I tried cutting and pasting some code from an ACCESS 2003
site, but it keeps giving me error messages like 'the name is not in the
table'. Does this make sense? Can anyone help me out

Please post your code. It's a bit hard to debug if we can't see it.

Posting the fieldnames and datatypes of the relevant fields in your Table
would help too.

John W. Vinson [MVP]
 
T

Tom Wickerath

Did you receive the sample database that I sent to you? The code you
indicated was not working works fine on my PC.


Note to anyone interested:
Pforecast contacted me by private e-mail, which included Not-In-List code
for a combo box. The code worked fine for me when I created a quickie test
database using Access 2003. I sent a zipped copy back, about 18 minutes
before this thread was opened.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
P

Pforecast

Thanks Tom.

I recieved your email and attachment late last night. It does work. So now
I'm using it. Thanks for the help.

Mark PFister
 
C

Chai

Tom,

I have a combo box in a table and the box is getting data from an external
table.
I'd like to be able to add data to the external table from the combo box.

Do you have a sample database? Thanks.

Chai
 
T

Tom Wickerath

Hi Chai,

Here are a few web pages that show you how to do this. The first link, on
Allen Browne's web site, shows how this process is much easier in Access 2007
versus prior versions:

Adding values to lookup tables
http://allenbrowne.com/ser-27.html

Add item to combo box using OnNotinList event
http://www.mvps.org/access/forms/frm0015.htm

Here is a link to a presentation I did several years ago, which includes a
sample database that you can download:

http://www.seattleaccess.org/downloads.htm

Scroll down towards the bottom of the page, where you should see this:

Not In List - Detailed Instructions by Tom Wickerath,

Download (16 kb)



Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
Top