表格与M:M的关系 [英] Forms With M:M relationship

查看:105
本文介绍了表格与M:M的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我目前正致力于使用Access 2003开发数据输入表单。我的父表单 Product 链接到另一个表单 Attribute ,通过多对多的关系。交集表使用两个表中的FK和唯一PK填充。我的问题是我无法使用表单向导创建链接。向导将填充相应表中的新记录,但不会在父产品及其属性之间建立链接,反之亦然。

任何帮助都会非常感激,我对访问或编码语言不是很熟练。但是如果有人花时间向我解释这个问题,我会非常感激。


谢谢大家的努力

解决方案

如果我理解你,你有一个产品表和一个属性表 - 每个产品都有很多属性。你可以拥有一种名为桃子的产品,它的属性将是甜美的,模糊的皮肤,长在树上。然后你可以得到一种名为葡萄的产品,具有甜美,光滑的皮肤,生长在葡萄藤上。如您所见,每个属性集描述了一个产品。这是一个(产品)到许多(属性)的关系。你有为多对多设置的关系。这是阻止Access为您的产品和属性设置父子关系的问题。尝试将关系窗口中的关系编辑为一对多,然后再次尝试向导。如果没有写回来


我道歉,我没有充分解释这种关系。例如,如果你有一个产品,桃子,它可能有几个属性,如甜,模糊等。但问题在于我们尝试使用相同的属性为其他产品。例如,属性sweet也可以与产品 apple 相关联。这就是为什么我们需要多对多的关系,因为一些属性将被重新用于产品。

我希望这有点澄清问题。


谢谢你的帮助


我真的不明白你在问什么。您能否详细说明每个表中哪些字段是主键和外键,以及每个表中数据类型的一些示例。


comteck

Hi ,
I am currently working on developing forms for data entry using access 2003. My parent form Product is linked to another form Attribute , via many to many relationship . the intersection table is populated with FK from both tables and a Unique PK . My problem is i am unable to create a link using the form wizard. the wizard populates the new records within the respective tables but it does not establish a link between the parent product and its attributes or vice versa.
any help would be much appreciated , I am not very proficient with access or coding languages . but if any one could take time out to explain this problem to me , I would really appreciate that.

Thank you all for your efforts

解决方案

If I am understanding you right, you have a product table and an attributes table - and each product can have many attributes. You could have a product called peach and its attributes would be sweet, fuzzy skin, grows on a tree. Then you could have a product called grape with attributes sweet, smooth skin, grows on a vine. As you see each SET of attributeS describes ONE product. this is a ONE (product) to many (attributes) relationship. You have the relationship set up for Many to Many. That is the issue that is preventing Access from setting up a parent child relationship for your products and attributes. Try editing the relationship in the Relationship window to One to Many then try the wizard again. If that doesn''t do it write back


My apologise , I did not explain the relationship well enough . For example if you have one product , peach and it may have several atrributes like sweet , fuzzy etc. But the problem lies when we try and use the same attributes for other products. For example attribute sweet can be associated with product apple as well . So that is why we need a many to many relationship , as some attributes will be re used for products.
I hope this clarifies the problem a bit.

Thank you for your help


I''m not really understanding what you''re asking either. Could you give a little more detail as to which of the fields are the primary and foreign keys in each table, and some examples of the types of data in each table.

comteck


这篇关于表格与M:M的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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