多对多关系带有基于表单的多项选择 [英] Many-to-many relation ship with form-based multi selection

查看:77
本文介绍了多对多关系带有基于表单的多项选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个数据库,我需要构建一种基于表单的输入方法,将数据添加到表中,同时保持我认为是多对多的关系.

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.

说Project X可以具有X,Y和Z部分-并且X,Y和Z部分可以用于多个项目.

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?

非常感谢.

推荐答案

多对多关系至少需要3个表.项目表,零件表和连接表ProjectParts. ProjectParts中的每个记录将是一个唯一的项目和零件对.数据输入表单的选项:

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. 使用组合框绑定到ProjectParts的一种形式,用于选择项目和零件

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

绑定到Projects的主窗体和绑定到ProjectParts的子窗体(带组合框以选择零件)

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

绑定到零件"的主窗体和绑定到带有组合框"的ProjectParts的子窗体以选择项目.

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

这实际上是非常基础的数据库设计.

This is really very basic database design.

这篇关于多对多关系带有基于表单的多项选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆