MS-Access, form that adds info to a one to many relationship

送分小仙女□ 提交于 2019-12-13 03:44:14

问题


I have a access table with Orders and a sub-table with itemId's. It has one to many relationship.

I want to create a form that adds itemId's to a selected order(already existing).

This is how i expect it to look like:

Order:        [            ]
ItemId:       [            ]
Measurement1: [            ]
Measurement2: [            ]

        [Save-button]

Can anyone help me with this?


回答1:


Subforms are the politically correct way to go IF you want users to have access to the order screen. If users do not need access to the order details directly, only to items, then you could put a combo-box for

 Order: [              [V]]

which has its control source as a query for your order ID in the orders table. Link that to your Orders field in the Item table and it will store the order as a subform would, without letting the user see details of the order.

However, if you want multiple items shown for a selected order, use subforms (having a subform which is multiple-item)




回答2:


Look into subforms. The Orders table will be for the main form and the items will be on the subform. Access does a good job of handling the OrderID key in the Items records.



来源:https://stackoverflow.com/questions/10883128/ms-access-form-that-adds-info-to-a-one-to-many-relationship

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