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!
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!
Comment