0

我正在 MS 2003 上建立一个数据库。我有一个需要一系列选项的表格。此表单基于通过客户 ID 链接到主表的“类别”表。

现在,两种形式一起出现在同一个屏幕上,我想做的是让人们选择一个或多个类别,然后按下命令按钮,然后选择的那些类别将显示其各自的形式。在被选中和按下命令按钮之前,表单是不可见的。

由于它们是两种不同的表单(一个类别)和另一个表单上的输入表单,我如何编程命令按钮以使输入表单从另一个表单可见?

子表单位于选项卡中。我不想将其显示为弹出窗口,而是在它所在的选项卡中可见

4

2 回答 2

1

如果表单已打开但不可见,则可以将其作为表单集合的成员引用并使其可见:

forms("myForm").Visible = true

如果表单未打开,则从项目的 AllForms 集合中获取其名称,然后使用 OpenForm 方法:

docmd.OpenForm currentproject.AllForms("myForm").Name, acNormal
于 2011-05-29T07:26:23.193 回答
0

Pseudologic: you are basically going to want to set the Visible property with all of your forms to False during the form's Open event. You should place this Visible = False code in a separate subroutine so that the code structure can be called during other events too. (For example you may want to provide a Reset button so that the user can reset the form, or trigger the "set false" code when a new customer id is selected.) Then with every selected category you would set its associated form property visible by setting Visible = True.

于 2011-05-31T20:28:52.027 回答