Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to return Null Record on Check Box

Status
Not open for further replies.

Sail101

Technical User
May 11, 2004
6
CA
I have a form created that allows the user to select the criteria for a query. They can enter ther file number (all or just the first part) they can also choose the Listing Type from a drop down box as well as other options for other feilds. I would like to have the option of including records were the Listing type is blank but only of a box is checked. I have the query working and can inclused the missing records using the or Is Null statement at the end of the fields Query, but I can not figureout how to make it an option.

here is the filter for the field:

Like IIf(([tblListings].[ListingType])=IsNull([Forms]![frmMain]![subfrmMain_Listings].[Form]![cmbListingTypeFilter]) Or [Forms]![frmMain]![subfrmMain_Listings].[Form]![cmbListingTypeFilter]="","*",[Forms]![frmMain]![subfrmMain_Listings].[Form]![cmbListingTypeFilter]) Or Is Null

and here is the box on the form
Forms![frmMain]![subfrmMain_Listings].Form![chkListingTypeIncludeNull]

Thanks for any help

Tim D.
 
WHERE ... AND (tblListings.ListingType Like Nz([Forms]![frmMain]![subfrmMain_Listings].Form![cmbListingTypeFilter], "*") OR (tblListings.ListingType Is Null AND [Forms]![frmMain]![subfrmMain_Listings].Form![chkListingTypeIncludeNull] = True)) ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top