|
-
Mar 30th, 2006, 07:19 AM
#1
Thread Starter
Member
[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,
-
Mar 30th, 2006, 07:28 AM
#2
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!
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2006, 11:08 AM
#3
Thread Starter
Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|