Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-11-08
4
Medium Priority
?
610 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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

972 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