MS Access 子子表单

发布于 2024-12-11 12:17:59 字数 313 浏览 0 评论 0原文

我使用 MS Access 作为 MySQL 数据库的前端。其中我有几个表,所有表都基于“家庭”和“人员”的概念(分别是一对多)。由此有几个多对多的连接表(例如种族和饮食限制)。我希望能够从 MS Access 中的单个表单中编辑此内容。

到目前为止,我已将其设置为可以编辑家庭信息、查看/编辑与其关联的所有人员,以及展开人员详细信息以查看与该人员记录关联的连接表中的 1 个(共 3 个)。我不知道如何让所有 3 个表都可见,有人知道如何做到这一点吗?

扩展中显示一个联接表。

I am using MS Access as a front end for a MySQL database. In it I have several tables, all based around the concept of a Household and People (one to many, respectively). From that there are several join tables (such as Ethnicity and Dietary Restrictions) which are many to many. I would like to be able to edit this from a single form in MS Access.

So far I have it set up so that I can edit the household information, view/edit all the people associated with it, and expand the person detail to view 1 (out of 3) of the join tables associated with that person record. I cannot figure out how to get all 3 tables to be visible, does anyone know how to do this?

One join table shown in the expansion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千里故人稀 2024-12-18 12:17:59

我将使用连续表单构建 3 个网格,或者在数据表视图中构建 3 个表单。

然后创建一个 4 个表单,并放入上面的 3 个表单。

在主窗体(现在是子窗体)中,在当前事件中,您
放置以下命令以使子窗体遵循此窗体。

me.Parent.Child1.Requery
me.Parent.Child2.Requery。

在子 1 的链接子/主设置中,您放置:

linkChildFields main_id(无论字段的名称是什么)
该子表单用于关联回父表)
LinkMasterFields [MasterForm].[form].[ID]

在子 2 表单的链接子/主设置中,放置

linkChildFields main_id (无论字段的名称是什么)
该子表单用于关联回父表)
LinkMasterFields [MasterForm].[form].[ID](“masterForm”是名称
用于保存主窗体的控件)。

“多”对多屏幕如下所示:

在此处输入图像描述

以上是经典的会计或资金分配,其中我们将 50 美元之类的金额分配给多个账户。

I would built 3 grids using continues forms, or 3 forms in data sheet view.

You then create a 4 form, and drop in the above 3 forms.

In the master form (which is now a subform), in the on current event, you
place the following command to make the child forms follow this form.

me.Parent.Child1.Requery
me.Parent.Child2.Requery.

In the link child/master settings for child 1, you place:

linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [MasterForm].[form].[ID]

In the link child/master settings for child 2 form you place

linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [MasterForm].[form].[ID] ("masterForm" is the name of
the contorl you used to hold the master form).

The "many" to many screen looks like this:

enter image description here

The above is a classic accounting or funds distribution in which we take an amount like $50 and distribute the amount over many accounts.

ゞ记忆︶ㄣ 2024-12-18 12:17:59

实际上,听起来像是一个结构问题。将您的财产附属表(饮食限制、职业等)(一个人可能拥有的多个财产)建立在您的个人信息表上,也许以某种个人 ID(雇主)为基础,不是更有效吗?经常使用 SSN,因为它们是独一无二的 - 尽管在您的情况下,您可能只是让它们自动生成)。像种族和家庭中的地位这样的项目是个人拥有的项目之一,并且您确实可以将其放入您的个人信息表中。

通过正确的结构和正确的查询工作 - 您可以拥有一个表单,允许您编辑族上的所有这些属性,同时保持引用完整性。

Sounds like a structure problem, actually. Wouldn't it be more efficient to base your property accessory tables (dietary restrictions, occupations, etc) - properties that a single person might possess a number of - on your personal information table, perhaps keyed to a individual ID of some sort (employers often use SSNs, as they are unique - though in your case, you might just make them auto-generating). Items like Ethnicity, and position within a household are something an individual possesses one of, and would be something you could indeed place within your personal information table.

With proper structuring, and the right query work - you can have a form that allows you to edit all of these properties on a family while keeping referential integrity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文