Add Records with same ID

misternumbertwo

Registered User.
Local time
Tomorrow, 02:43
Joined
Dec 29, 2008
Messages
11
Hi guys,

I have three tables. the first one contains addresses with regards to the shipment in transit. the next table contains the details regarding the sender and the receiver and the third table contains the items that are to be shipped.

I created a PK in the 1st table and then linked them altogether by placing Foreign keys in the other two tables.

Here's my problem. I use forms to populate the information in the database. I'm using three separate form for each table. When i try to update my second table, it wouldn't save the data coz its saying that the its a violation of integrity rules.

How can i make my Foreign keys increment when my PK increments?
 
How can i make my Foreign keys increment when my PK increments?
I think you may have made a common mistep when building this.

Your main table has fields (example only):
Shipments
ShipmentID - Autonumber (PK)
ShipmentDate - Date
AddressID_Sen - Long Integer (FK)
AddressID_Rec - Long Integer (FK)

Addresses
AddressID - Autonumber (PK)
ContactName - Text
Address - Text
City - Text
State - Text
PostCode - Text


So where you see AddressID_Sen is where Address ID is stored for the sender and you see AddressID_Rec is where the Address ID is stored for the receiver but both are really AddressID from the Addresses table but can identify two different records in that table.

You would have a combo box to select shipper bound to the field AddressID_Sen and a separate combo to select from the same records to the field AddressID_Rec on the form that stores the data into the shipment table.
 

Users who are viewing this thread

Back
Top Bottom