显示/隐藏子表单 [英] Show/hide Subform

查看:180
本文介绍了显示/隐藏子表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个表格。主要表格将更多的是一个开关板,其中包含与一个项目相关的摘要信息。


每个项目有3个主要类别。所以摘要看起来像这样:

item 1 Item 2 Item3

Cat 1 100 20 5

Cat 2 1000 100 0

Cat 3 0 5 50


其中

项目1是目标

项目2是当前

项目3是预计的


每个类别都有一组子类别


我想要什么要做的是让用户点击Cat 1(ECT)的标签并有一个子表格显示具有Cat 1的子项目。在SubForm上将是一个隐藏子表单的按钮



所以基本上我需要一种方法从主窗体中将子窗体的visible属性设置为true。然后在子窗体中将其设置为false。

I am building a form. The main form will be more of a switch board with summary information related to one project.

Each project has 3 main categories. So the summary would look something like this:
item 1 Item 2 Item3
Cat 1 100 20 5
Cat 2 1000 100 0
Cat 3 0 5 50

Where
Item 1 is the goal
Item 2 is the current
Item 3 is the projected

Each Category then has a set of Sub Categories

What I would like to do is have the user click on the label for Cat 1 (ECT) and have a subform show that has the Sub Items for Cat 1. On the SubForm would be a button to hide the subform


So basically I need a way to set the visible property of a subform to true from the main form. And then set it to false from with in the subform.

推荐答案

窗体上控件属性的绝对路径为:

[表格]![表格名称]![控制名称] .propertyname
The absolute path to the property of a control on a form is:
[Forms]![Form Name]![Control Name].propertyname


感谢您的快速回复



所以我的测试我有


表格1 = MainForm

表格2 = BlankForm


表格2包含在表格中1作为SubForm


在标签1的OnClick事件中,我将代码设置为


[Forms]![MainForm]。[BlankForm] ]![可见] =真


在命令按钮的子窗体中,我将On Click设置为


[Forms]![ MainForm]。[BlankForm]![可见] =错误


离开所有括号


那是gest吗?
Thank you for fast reply


So for my test I have

Form 1 = MainForm
Form 2 = BlankForm

Form 2 is embeded in Form 1 as a SubForm

In the OnClick Event of Label 1 I set the code to

[Forms]![MainForm].[BlankForm]![Visible] = True

And in the subform in a command button I set the On Click to

[Forms]![MainForm].[BlankForm]![Visible] = False

Leaving out all brackets

Is that the gest?


这就是要点。但你必须翻转。最后一个!

在您的情况下,您可以不使用括号,当您有非常表格时使用括号表单名称中包含带空格的名称或某些非字母数字字符。
That''s the gist. But you have to flip the . and the last !
In your case you can leave off the brackets, the brackets are used when you have unconventinonal Form names likes names with a space in it or some non-alphanumeric character.


这篇关于显示/隐藏子表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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