子表格过滤? [英] Sub Form Filter?

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

问题描述

我有一个表格上有一个Tab控件。在其中一个标签控件

页面上,只有3个页面,是一个基于一个名为

部门的字段组合框。


当用户从组合框中选择一个部门时,我想要一个

子表单在选项卡控件页面上打开,基于部门

选择了。


子表格基于一个提取所有员工数据的查询,因此如果一个

用户选择了录取,我希望子表单能够打开并且只显示

记录为招生离开。


我可以打开子表单并显示所有记录,但我可以

没弄明白如何让它只显示我想要的记录。


我该怎么做?


预先感谢您的帮助!


Michael Charney


***通过Developersdex发送 http://www.developersdex.com ***

Don'只是参加USENET ...获得奖励!

解决方案

子表单上的部门字段需要引用选项卡控件,

然后每当你点击标签时重新查询子表格。


没什么 < me@you.com>在消息新闻中写道:41 ********** @ 127.0.0.1 ...

我有一个表格上有一个Tab控件。在其中一个标签控件页面上,只有3个页面,是一个基于表格中某个字段的组合框。

当用户选择其中一个从组合框的部门我想要一个
子表单在选项卡控件页面上打开基于选择的部门。

子表单基于查询这会拉动所有员工的数据,所以如果
用户选择了录取,我希望子窗体打开并且只显示录取的记录。

我可以获得子表格打开并显示所有记录,但我不知道如何只显示我想要的记录。

我该怎么做?

提前感谢您的帮助!

Michael Charney

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!



没有写过:

我有一个表格上有一个Tab控件。在其中一个标签控件页面上,只有3个页面,是一个基于表格中某个字段的组合框。

当用户选择其中一个从组合框的部门我想要一个
子表单在选项卡控件页面上打开基于选择的部门。

子表单基于查询这会拉动所有员工的数据,所以如果
用户选择了录取,我希望子窗体打开并且只显示录取的记录。

我可以获得子表格打开并显示所有记录,但我不知道如何只显示我想要的记录。

我该怎么做?

提前感谢您的帮助!

Michael Charney

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!




您可以将过滤器放在子表单的查询中。在Criteria

系的部门你可以输入类似

Forms!MainFormName!ComboDeptName


然后只有匹配的记录将显示部门组合。


我试图在查询的条件和

中添加过滤器filter属性中的表单。 (不是在同一时间)但是形式

不会随着组合框中的更改而改变。它仍显示所有

reords。


我做错了什么? (愚蠢的问题!)是否有一些示例代码

我可以在某个地方工作吗?


Michael Charney


* **通过开发人员指南 http://www.developersdex.com 发送***
不要只是参加USENET ......获得奖励!


I have a form that has a Tab Control on it. On one of the tab control
pages, there are only 3 pages, is a combo box based on a field called
departments in a table.

When the user selects one of the departments from the combo box I want a
sub-form to open on the tab control page based on the department
selected.

The sub-form is based on a query that pulls all employee data, so if a
user selects admissions, I want the subform to open and only display
records for the admissions depart.

I can get the sub-form to open and display all the records, but I can
not figure out how to make it display only the records I want.

How would I do this?

Thanks in advance for any help!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

解决方案

The department field on the sub form needs to reference the tab control,
then requery the sub-form whenever you click on a tab.

"Nothing" <me@you.com> wrote in message news:41**********@127.0.0.1...

I have a form that has a Tab Control on it. On one of the tab control
pages, there are only 3 pages, is a combo box based on a field called
departments in a table.

When the user selects one of the departments from the combo box I want a
sub-form to open on the tab control page based on the department
selected.

The sub-form is based on a query that pulls all employee data, so if a
user selects admissions, I want the subform to open and only display
records for the admissions depart.

I can get the sub-form to open and display all the records, but I can
not figure out how to make it display only the records I want.

How would I do this?

Thanks in advance for any help!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



Nothing wrote:

I have a form that has a Tab Control on it. On one of the tab control
pages, there are only 3 pages, is a combo box based on a field called
departments in a table.

When the user selects one of the departments from the combo box I want a
sub-form to open on the tab control page based on the department
selected.

The sub-form is based on a query that pulls all employee data, so if a
user selects admissions, I want the subform to open and only display
records for the admissions depart.

I can get the sub-form to open and display all the records, but I can
not figure out how to make it display only the records I want.

How would I do this?

Thanks in advance for any help!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



You could put the filter in the query of the subform. In the Criteria
line of Department you could enter something like
Forms!MainFormName!ComboDeptName

Then only records that match the dept combo will be displayed.


I have tried to add the filter in both the criteria of the query and on
the form in the filter property. (Not at the same time) but the form
doesnt change with the change in the combo box. It still displays all
the reords.

Am I doing something wrong? (Stupid question!) Is there some sample code
I can exaime somewhere?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


这篇关于子表格过滤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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