表格负荷和过滤问题 [英] Form load and filter question

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

问题描述

我在做一个搜索表单。在上面,有几个组合框供用户选择指标分析相结合。然后,我建立一个字符串,哪里来筛选子的形式显示结果。

I'm doing a search form. On top, there are several comboboxes for users to choose a combination of criterias. Then I construct a Where string to filter a sub form displaying the results.

Me.sub.SourceObject = "subResultType_1"
Me.sub.Form.Filter = strWhere
Me.sub.Form.FilterOn = True

这code是在搜索按钮的点击事件。

This code is in the "Search" button's click event.

现在的问题是,当执行 Me.sub.SourceObject =subResultType_1,子窗体将显示所有记录。然后,它被过滤。但我要的是子窗体显示什么,直到它被过滤。这是因为我的节目将被用作前/后端的相当缓慢的网络上。

The problem is, when Me.sub.SourceObject = "subResultType_1" is executed, the subform will display all the records. Then it gets filtered. But what I want is the subform displays nothing until it gets filtered. This is because my program will be used as front/back end on the rather slow network.

PS:我认为当与WHERE部分SQL子句或过滤器的形式,它被过滤在后端。所以数据的只有一点点量将网络向前端上进行传输。如果我错了这一点,告诉我...

PS: I think when a SQL clause with the WHERE part, or a form with filter, it gets filtered on the back end. So only a little amount of data will be transmitted on the network to the front end. If I'm wrong on this, tell me...

推荐答案

另一种是我经常使用的,这是为了保存子窗体与产生一个空白的,不可编辑的记录中的记录源。在SQL我一般用的是这样的:

An alternative is one that I often use, which is to save the subform with a recordsource that produces one blank, uneditable record. The SQL I usually use is something like this:

  SELECT TOP 1 Null As Field1, Null As Field2, 0 As Field3
  FROM MyTable;

这显示与空值对于某些字段,为他人有一页空白的记录,0(如适用)。我觉得化妆品超过了替代的吸引力。

This displays one blank record with Nulls for some fields, 0 for others (as appropriate). I find it cosmetically more attractive than the alternative.

当我准备显示过滤设置,更改设置过滤器的记录源代替。

When I'm ready to display a filtered set, I change the Recordsource instead of setting a filter.

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

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