View Full Version : Copy a field from one table to another using a form


jasongera
12-24-2010, 11:03 AM
I have two tables

Terminal (Table Table 1)
Terminal and Merchant Table (Tabel 2)

I would like to copy terminal number from terminal table to terminal number in Terminal and Merchant Table. These tables are joined by Terminal id as PK from Termianl Table and Terminal ID from Terminal and Merchant Table.

Please also note that I want to update this filed via a form

Can you please provide me with some help

John Big Booty
12-24-2010, 01:43 PM
Welcome to the forum.

If you use a combo box that uses table Terminal as it's row source you will achieve your goal. Simply follow the Combo Box wizard.

You might also want to consider a naming protocol for your DB objects and controls, something along the lines of; TBL_TableName, FRM_FormName, QRY_QueryName etc. Also avoid using spaces and other special characters in names, limit yourself to alpha and numeric characters and the underscore (_)

jasongera
12-25-2010, 05:15 AM
Many thanks for your help I have one more question maybe you can help please.

the three main tables are

Merchants Table
Terminal Table
Merchants and Terminal Table (which relates both tables)

I have a problem since a terminal can ony be assigned once but merchants can have more than one terminal assigned to them.

When I tried to create a one to one relationship between terminals Table and Merchant and Terminals table I found out that the tables are not working well and various problems were rising such as

when deleting a terminal from the merchant area the database was deleting both records from the Terminal table and Merchants and Terminal table.

To avoid this I created a one to many relationship and it worked perfecty but the problem now is that one terminal can be assigned on various merchants and I do not want this. Please can you help me to find a solution since I want that one terminal is only assigned once.

John Big Booty
12-25-2010, 02:12 PM
The attached sample demonstrates how I might deal with your situation.

jasongera
12-26-2010, 04:46 AM
Dear John

Many thanks for your help I really appreciate it since I am still a beginner on access.

Regards
Jason