View Full Version : Value from one table into another


patnick
03-05-2009, 01:13 AM
Hi folks,

My problem:
Table1: with 1 column of names.
I created a Form with a ComboBox to select one of these names from the Table.

Now I want to use the selected name in a new table (Table2).
How do I have to make the link that this name apperas in the second table?

Many thanks for your help in advance!
Patnick

DCrake
03-05-2009, 06:00 AM
It is not the name that you want to appear in the second table it is the Id if the person you want to append. Why? Let's say Jane Smith is picked from the list and you append "Jane Smith" to the second table. Jane then gets married and becomes Jane Brown, you link between the two table will be broken. however if Jane's PK is say 100 and then second table has 100 as its foreign key linked to the Primary key in table one then any changes in table one will be casecaded through to table two.


Lecture over, run an append query to add the new record to the table.

patnick
03-05-2009, 07:51 AM
Many thanks DCrake,

but I still have the problem that table2 doesn't receive the information from the combo box:

I am working now just with numbers in table1
Then I created the relationship between table1 (OrderNumber) and
the blank table2 where the information should be stored.

By selecting ONE number - from a created combo box in a form - this number will not get stored in table2 automatically.
Table2 doesn't know to retreive the selected data from the combo box and I don't know how to insert this process.

EraserveAP
03-05-2009, 09:46 PM
If you wish to append the names to an existing table you could craft an SQL "Insert Into" statement and then execute it using DAO.