Solved

Retrieve Nulls in an Access query

Posted on 2014-09-30
1
178 Views
Last Modified: 2014-09-30
I have a query pulling information from a table of 800 records.  The query has a field that is linked to a combo box with the default value of "*".  The query, when using "*", will only pull back values that are in the field.  It will not pull back Nulls in the field.  I want everything to come back when ising "*".  I tried wrapping my criteria in Nz() but that doesn't work.  It still only pulls back values that exist.  I current have this now:

Like Nz([Forms]![frm_Campus_offer_Main]![CboFunction]) & "*"

Is there a way to write the criteria to pull back everything when the combo box is "*", including nulls?
0
Comment
Question by:marku24
1 Comment
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 40352902
I prefer to build separate column:
IIF(isnull([Forms]![frm_Campus_offer_Main]![CboFunction]),True,IIF([YourField] like ([Forms]![frm_Campus_offer_Main]![CboFunction] & "*"),true, false))
with criteria: True
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now