如果没有记录,则通过Combo进行查询 [英] FIltering query via Combo if there aren't records

查看:77
本文介绍了如果没有记录,则通过Combo进行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有一个由Combobox使用以下代码(在查询设计的标准中引入)更新的查询,以在Field1中进行过滤/>
调试代码:

Hello,

I have a query that is being updated by a Combobox using the following code (introduced at the criteria of the query design) to do a filter in Field1

Debug Code:

展开 | 选择 | Wrap | 行号

推荐答案

确实。 Like * 将匹配具有或不存在的字符串值。它不匹配 Null s。


如果你想抓住值那么尝试:
Indeed. Like * will match string values that have something or nothing. It won''t match Nulls.

If you want to catch empty values too then try :
展开 | 选择 | Wrap | 行号


@NeoPa


感谢您的时间和帮助。

使用这行代码,会发生什么:

1)如果combobox1为空,则显示所有结果

2)如果Combobox1例如,选项1具有选项1。选择,然后全部选项1。结果显示加零值。


为了获得以下结果:

1)如果combobox1为空,则显示所有结果(与之前相同) )

2)例如,如果Combobox1具有选项1和选项1。选择,然后仅选择选项1。结果显示。


我刚刚在Null标准中添加了combobox1。

@NeoPa

Thank you for your time and help.
With that line of code, what happens is:
1) If combobox1 is empty, all results are shown
2) If Combobox1 has, for example, "Option 1" selected, then all "Option 1" results are shown plus Null Values.

In order to obtain the following results:
1) If combobox1 is empty, all results are shown (same as before)
2) If Combobox1 has, for example, "Option 1" selected, then only "Option 1" results are shown.

I just added the combobox1 in the Null criteria.

展开 | 选择 | 换行 | 行号


Antonio。


随着问题的变化,很难给出可行的答案。其他ComboBox值在哪里适合这个?


添加额外的 Null 测试不太可能产生你想要的效果。但是,在我有一个明确定义的问题可以解决之前,很难说清楚。
Antonio.

It''s hard to give a workable answer with the question changing as we go along. Where do other ComboBox values fit into this?

Adding your extra Is Null test is unlikely to have the effect you want. It''s hard to say anything definitively though, until I have a clearly defined question to work with.


这篇关于如果没有记录,则通过Combo进行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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