Many-to-many relation ship with form-based multi selection

北城以北 提交于 2019-12-24 10:09:21

问题


I am creating a database and I need to construct a form-based entry method of adding data into my tables, whilst maintaining what I believe is a many-to-many relationship.

Say Project X can have Parts X, Y and Z - and Parts X, Y and Z can be used on more than one project.

What is the best way of allocating a list of 'parts' to a project through a form, without have a huge array of tickboxes, and how do I construct my tables to accommodate this?

Much appreciated.


回答1:


Many-to-Many relationship requires 3 tables minimum. Table for Projects, table for Parts, and junction table ProjectParts. Each record in ProjectParts will be a unique project and part pair. Options for data entry form:

  1. one form bound to ProjectParts with comboboxes to select project and part

  2. main form bound to Projects and subform bound to ProjectParts with combobox to select part

  3. main form bound to Parts and subform bound to ProjectParts with combobox to select project.

This is really very basic database design.



来源:https://stackoverflow.com/questions/43536938/many-to-many-relation-ship-with-form-based-multi-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!