[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

hierarchical relation in access

Hey Everyone!

I am trying to create a hierarchical relation in access.
I creating a desktop database application for an Automobile Repair Shop. In that I have created an entity ServiceID which is the parent Entity. Further this entity will have children such as Repair, Maintenance and BuySell.

I have attached a snapshot of the ERD.

How should I implement this in my application?

Any suggestions?

Thank you!
DB1.jpg
0
varshneyprateek
Asked:
varshneyprateek
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
First: Your Repair, Maintenance and BuySell tables should NOT use the ServiceID as their Primary Key. That should be the Foreign Key field, and you should create another field for those tables' Primary Key.

If a single Services record can contain more than one of those downstream entities (or can contain multiples of a single downstream entity) then you'll need to create a Many-to-Many "bridge" table. This would be a table that stores (a) the Services.ServiceID value and (b) the PK value from the second table. So if you add a new field to the Repair table named RepairID, you'd store the value of that field in the bridge table along with the ServiceID of the parent record.
0
 
Helen FeddemaCommented:
See my sample database illustrating many-to-many relationships:

http://www.helenfeddema.com/Files/accarch178.zip

and here is an image of one of its forms:

Many-to-many relationships form
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now