Solved

Access query does not display records with empty fields - Can you help please

Posted on 2014-11-08
4
458 Views
Last Modified: 2014-11-10
I have a query that gets its criteria values from a form.
I have cleared the form so there are no filters/constraints. That means Combo405 and Combo406 "below" are empty (set equal to "").
However when any field in the table is empty, that record does not show up in the query.
For instance i have two records with the same [Property] value, but one does not have a value in the [Owner] field. Then my query only displays the record that has a property value and a Owner value in the underlying table.

My query looks like below.


View of query
0
Comment
Question by:Fritz Paul
  • 2
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40430528
use NZ(MyField) for those fields

TheOwner: Nz( [Owner])     '<-- this inserts empty string for the missing owners.

or

TheOwner: Nz( [Owner],"tbd")
0
 

Author Comment

by:Fritz Paul
ID: 40432077
Hi,

My database design view now looks like below. The query now includes even those records without values. Thanks.

But now the query is not updatable anymore, because I changed all the names adding an X after the name. If I keep the query field names the same I get a circular reference error.

Is there a way that I can still keep the query updatable?

Please what do you mean by the "tbd"?

New query design view.
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 500 total points
ID: 40432485
re:> Please what do you mean by the "tbd"?

Stands for "to be determined" if missing.
------
re:> Is there a way that I can still keep the query updatable?

Can't you add an "X" at the end of your Control Source properties for the affected text boxes.
----------------
As a last resort, remove the existing NZ() but change the criteria:

Like "*" & [Forms]![frmTasksSelect]![Combo405] or Nz([Forms]![frmTasksSelect]![Combo405]."")=""

same for the other one. Check for typos.

Mike
0
 

Author Closing Comment

by:Fritz Paul
ID: 40432591
Thanks a lot.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

830 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