选项卡控件上子表单上的引用字段 [英] reference field on subform on tab control

查看:60
本文介绍了选项卡控件上子表单上的引用字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何过滤属于选项卡控件的子窗体的记录?

当窗体不是选项卡的一部分时,过滤器可以正常使用

这在宏观条件下:

[Forms]![sfmEmploymentVerification]![OpenedDateFilter] =" Today"


我有一个主表单选项卡控件有三个选项卡,每个选项卡上有一个子窗体。


主窗体:frmEmploymentVerification

选项卡控件名称:TabEmployment

子表格:sfmEmploymentVerification6M

子表格字段:OpenedDateFilter


我的过滤器是一个列出本周,上个月等等

显示相应的记录。这个组合框当前位于子窗体本身的

上,并且正在使用宏来应用过滤器。这是我在条件字段中的含义:


[表格]![frmEmployment]![subMySubform]。[Form]![OpenedDateFilter] = 这个




我收到一条错误消息:该操作或方法无效,因为

formor报告不是没有绑定到表或查询。


我的子表单绑定到查询,所以我不知道从哪里开始。

组合框是否应该成为标签页而不是子表单的一部分?


任何让我朝着正确方向前进的帮助都会很棒。

谢谢

How can I filter records of a subform that is part of a tab control?
The filter works fine on the form when it is not part of the tab using
this in the macro condition:
[Forms]![sfmEmploymentVerification]![OpenedDateFilter]="Today"

I have a main form with a tab control which has three tabs and on each
tab there is a subform.

Main Form: frmEmploymentVerification
Tab Control Name: TabEmployment
Sub Form: sfmEmploymentVerification6M
Field on Sub Form: OpenedDateFilter

My filter is a combo box that lists "This Week", "Last Month" etc to
show the appropriate records. This combo box is currently located on
the subform itself and is using a macro to apply the filter. This is
what I have in the condition field:

[Forms]![frmEmployment]![subMySubform].[Form]![OpenedDateFilter]="This
Week"

I get an error saying: The action or method is invalid because the
formor report isn''t bound to a table or query.

My subform is bound to a query so I''m not sure where to go from here.
Should the combo box be part of the tab page instead of the subform?

Any help to get me going in the right direction would be great.
Thanks

推荐答案

要做的第一件事是忘记标签控件 - 它与

无关子窗体引用的语法。
the first thing to do is forget the tab control - it has nothing to do with
the syntax of the subform reference.

当窗体不是选项卡的一部分时,过滤器在窗体上工作正常
The filter works fine on the form when it is not part of the tab



i怀疑你是从数据库窗口 - <打开子窗体br />
并假设当你打开主窗体时因为

选项卡控件而无法正常工作,但这个假设是不正确的。

i suspect that you opened the subform by itself, from the database window -
and assumed that it didn''t work when you opened the main form because of the
tab control, but that assumption is not correct.


这就是我在条件字段中所拥有的:


[表格]![frmEmployment]![subMySubform]。[Form]![OpenedDateFilter] ="这个
This is what I have in the condition field:

[Forms]![frmEmployment]![subMySubform].[Form]![OpenedDateFilter]="This






没关系,该表达式中唯一匹配的名称是OpenedDateFilter -

表单和子表单名称与您为这些

对象发布的名称不匹配。

Week"

okay, the only matching name in that expression is OpenedDateFilter - the
form and subform names do not match the names that you posted for those
objects.


主表单:frmEmploymentVerification

标签控制名称:TabEmployment

子表格:sfmEmploymentVerification6M

子表格字段:OpenedDateFilter
Main Form: frmEmploymentVerification
Tab Control Name: TabEmployment
Sub Form: sfmEmploymentVerification6M
Field on Sub Form: OpenedDateFilter



假设那些是真实的并且正确的对象名称,请尝试下面的条件表达式




[表格]![frmEmploymentVerification]![sfmEmploymentVerification6M]。[表格]! [Op

enedDateFilter] ="这个

周>


hth

" mchlle" ; < mc **** @ austin.rr.com写了留言

新闻:11 ********************** @ p79g2000cwp .googlegr oups.com ...

assuming that those are the "real" and correct names of your objects, try
the following conditional expression, as

[Forms]![frmEmploymentVerification]![sfmEmploymentVerification6M].[Form]![Op
enedDateFilter]="This
Week"

hth
"mchlle" <mc****@austin.rr.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...


如何过滤属于选项卡控件的子窗体的记录?

过滤器在宏观条件下使用

时,在表单上工作正常:

[Forms]![sfmEmploymentVerification]![OpenedDateFilter] ="今天


我有一个带有标签控件的主窗体,它有三个标签,每个标签上都有一个子窗体。


主要表格:frmEmploymentVerification

标签控制名称:TabEmployment

子表格:sfmEmploymentVerification6M

子表格字段:OpenedDateFilter


我的过滤器是一个组合框,列出本周,上个月和上周。等等

显示相应的记录。这个组合框当前位于子窗体本身的

上,并且正在使用宏来应用过滤器。这是我在条件字段中的含义:


[表格]![frmEmployment]![subMySubform]。[Form]![OpenedDateFilter] = 这个




我收到一条错误消息:该操作或方法无效,因为

formor报告不是没有绑定到表或查询。


我的子表单绑定到查询,所以我不知道从哪里开始。

组合框是否应该成为标签页而不是子表单的一部分?


任何让我朝着正确方向前进的帮助都会很棒。

谢谢
How can I filter records of a subform that is part of a tab control?
The filter works fine on the form when it is not part of the tab using
this in the macro condition:
[Forms]![sfmEmploymentVerification]![OpenedDateFilter]="Today"

I have a main form with a tab control which has three tabs and on each
tab there is a subform.

Main Form: frmEmploymentVerification
Tab Control Name: TabEmployment
Sub Form: sfmEmploymentVerification6M
Field on Sub Form: OpenedDateFilter

My filter is a combo box that lists "This Week", "Last Month" etc to
show the appropriate records. This combo box is currently located on
the subform itself and is using a macro to apply the filter. This is
what I have in the condition field:

[Forms]![frmEmployment]![subMySubform].[Form]![OpenedDateFilter]="This
Week"

I get an error saying: The action or method is invalid because the
formor report isn''t bound to a table or query.

My subform is bound to a query so I''m not sure where to go from here.
Should the combo box be part of the tab page instead of the subform?

Any help to get me going in the right direction would be great.
Thanks



你是对的我在

数据库窗口中自行测试了子窗体上的过滤器但是我也从主窗体运行它,包括

标签控件。
You''re right I tested my filter out on the subform by itself from the
database window but I did also run it from the main form which includes
the tab control.

i怀疑你自己打开子窗体,来自数据库窗口 -

并假设它没有由于

选项卡控件打开主窗体时rk,但该假设不正确。
i suspect that you opened the subform by itself, from the database window -
and assumed that it didn''t work when you opened the main form because of the
tab control, but that assumption is not correct.



对于这个条件字段我很抱歉我在另一个表单上测试它并且

复制并粘贴了错误的字段。

Sorry about this condition field I was testing it on another form and
copied and pasted the wrong one.


这就是我在条件字段中的含义:


[Forms]![frmEmployment]![subMySubform ]。[Form]![OpenedDateFilter] =" This
This is what I have in the condition field:

[Forms]![frmEmployment]![subMySubform].[Form]![OpenedDateFilter]="This



Week"

Week"



这是真实的正确的对象名称。

This is the "real" and correct names of my objects.


主要表格:frmEmploymentVerification

标签控制名称:TabEmployment

子表格:sfmEmploymentVerification6M

子表格上的字段:OpenedDateFilter
Main Form: frmEmploymentVerification
Tab Control Name: TabEmployment
Sub Form: sfmEmploymentVerification6M
Field on Sub Form: OpenedDateFilter


>> [Forms]![frmEmploymentVerification]![sfmEmploymentVerification6M]。[Form]!
[OpenedDateFilter] =" This Week"
>>[Forms]![frmEmploymentVerification]![sfmEmploymentVerification6M].[Form]!
[OpenedDateFilter]="This Week"



这是我原来的,但复制并粘贴你的以防万一

我错过了一些东西而且我得到了同样的东西错误:


操作或方法无效,因为表格或报表不会对表或查询绑定



随后的操作失败窗口。


我的主窗体或制表符控件不受任何限制。他们需要

吗?

This is what I had originally but copied and pasted yours just in case
I missed something and I got the same error:

The action or method is invalid because the form or report isn''t bound
to a table or query.
With an action failed window following.

My main form or tab control are not bound to anything. Do they need to
be?


评论内联。


" mchlle" < mc **** @ austin.rr.com写了留言

新闻:11 ********************* @ i3g2000cwc。 googlegrou ps.com ...
comments inline.

"mchlle" <mc****@austin.rr.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...

这是真实的正确的对象名称。
This is the "real" and correct names of my objects.

主要表格:frmEmploymentVerification

标签控制名称:TabEmployment

子表格:sfmEmploymentVerification6M

子表格字段:OpenedDateFilter
Main Form: frmEmploymentVerification
Tab Control Name: TabEmployment
Sub Form: sfmEmploymentVerification6M
Field on Sub Form: OpenedDateFilter



>> [Forms]![frmEmploymentVerification]![sfmEmploymentVerification6M]。[表格]!
>>[Forms]![frmEmploymentVerification]![sfmEmploymentVerification6M].[Form]!

> [OpenedDateFilter] =" This Week"
>[OpenedDateFilter]="This Week"



这是我最初的原因,但为了以防复制和粘贴你的东西

我错过了一些东西而且我得到了同样的东西错误:


操作或方法无效,因为表格或报表不会对表或查询绑定



随后的操作失败窗口。


我的主窗体或制表符控件不受任何限制。他们需要

吗?


This is what I had originally but copied and pasted yours just in case
I missed something and I got the same error:

The action or method is invalid because the form or report isn''t bound
to a table or query.
With an action failed window following.

My main form or tab control are not bound to anything. Do they need to
be?



完全忘记制表符控件。不,当你过滤绑定的子表单时,主表单不需要绑定到记录集上。实际上,我认为我在上一篇文章中发生了一次愚蠢的攻击。由于宏从子窗体中运行,而控件OpenedDateFilter也在子窗体中,因此你不必使用完整的引用。试试


[OpenedDateFilter] ="今天>


hth

forget the tab control entirely. no, the main form doesn''t need to be bound
to a recordset when you''re filtering a bound subform. actually, i think i
had a stupid attack in my last post. since the macro is running from within
the subform, and the control OpenedDateFilter is also in the subform, you
shouldn''t have to use the full reference at all. try

[OpenedDateFilter] = "Today"

hth


这篇关于选项卡控件上子表单上的引用字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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