问题描述
我有一个表单查询要求:
开始日期(字段名称是txtDate1)
结束日期(字段名称为txtDate2)
分销商(组合框名称为cboDist)
客户端(组合框名称为cboClient)
如果最终用户填写了每个字段,qeury会提示数据,但如果开始和怎么办?不需要结束日期,和/或分销商或客户?
其中任何一个标准都应该为最终用户产生结果。嗯,那是我的愿望。然而;如果每个字段都包含数据,我只能获得所需的结果。
查询具有:
日期:
之间[表格]![frmMain]![txtDate1]和[表格]![frmMain]![txtDate2]
客户 :
[ClientName] = [Forms]![frmMain]![cboClient]或[Forms]![frmMain]![cboClient] Null
(我有' ;真正的在标准部分)
经销商:
[Distame] = [表格]![frmMain] ![cboDist]或[表格]![frmMain]![cboDist] Null
(我的标准部分中有true)
我试过Is Null在每个查询列的Or点,但是没有用。
有什么建议吗?
谢谢!
I have a query by form that asks for:
Start Date (field name is "txtDate1")
End Date (field name is "txtDate2")
Distributor (combo box name is "cboDist")
Client (combo box name is "cboClient")
The qeury brings up the data just fine if the end user has every field filled in, but what if Start and End dates are not needed, and/or the distribitor or client?
Any one of them with criteria in them should produce results for the end user. Well, that''s my wish. However; I can only get desired results if each field has data in it.
The query has this:
Date:
Between [Forms]![frmMain]![txtDate1] And [Forms]![frmMain]![txtDate2]
Client:
[ClientName]=[Forms]![frmMain]![cboClient] Or [Forms]![frmMain]![cboClient] Is Null
(I have "true" in the criteria part of that)
Distributor:
[Distame]=[Forms]![frmMain]![cboDist] Or [Forms]![frmMain]![cboDist] Is Null
(I have "true" in the criteria part of that)
I tried "Is Null" in the Or spot of each query column, but that didn''t work.
Any suggestions?
Thank you!
推荐答案
这篇关于按表单w / null选项查询。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!