[RESOLVED] how to create composite primary key in access
Hai everyone, i have two tables Center and Batch.
The fields are,
Center:
Center_id,Centername
Batch:
Batch_id,Batchtiming,Center_id
The two tables are related by Center_id. In the center table Center_id is the primary key and in Batch table Batch_id is the primary key. I want to combine in Batch_id and Center_id in Batch table since i have multiple entries of Batch_id in the Batch table, which is not allowed when i have only Batch_id as primary key.
Please help me out. Thank you,
Re: how to create composite primary key in access
Manually...
Open your Batch table in design view and select the Center_Id row and hold down the shift key and select the batch_id row so they are both highlighted (they need to be contiguous. If there not just drag and drop so they are next ot each other). Then clikc on the primary key toolbar button and viola! :D
Re: how to create composite primary key in access
Hai, i have another table SD3 which has three fields Batch_id,Center_id and Stud_id. I want to reference Batch_id in SD3 to Batch_id in Batch table which is a composite of Batch_id and Center_id. I am not able to referece these two tables with Batch_id, it says "No unique index found for the refereced field of the primary table"
Thank you.