Link to home
Create AccountLog in
Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Avatar of perplexed71
perplexed71

Excluding Null and '0' Value Fields from Reports
This may be a very simple thing...

Have all my fields layed out in a report.  I don't want the report to display them if they are either Null or have a value of Zero.

The report is driven off a relatively simple query build in the query designer.

Any clever ideas?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of peter57rpeter57r🇬🇧

Hello perplexed71,

What are you currently showing for Null values?


Pete

Avatar of nico5038nico5038🇳🇱

Null values won't print so only zero will have to be removed e.g. in the query using:
FieldX:IIF([field]=0,Null,[field])

This will require a chenge of the fieldnames on the report. Another option is to use conditional formatting and select for the [field] the fontcolor white when equal zero :-)

Nic;o)

Avatar of perplexed71perplexed71

ASKER

Well, if there are Null values - The spaces and places are still being held open and it shows gaps in the report.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of nico5038nico5038🇳🇱

Then you need to specify a condition to skip the rows with null or zero's only.
For this a calculation like:
select NZ(field1)+NZ(field2)+NZ(field3) as TestZero from tblX WHERE NZ(field1)+NZ(field2)+NZ(field3) > 0;

can be used.

Nic;o)

you could add this as criteria to the query.

WHERE Not IsNUll([FieldOne]) AND ([FieldOne]) <> 0

Steve

Okay - it may be easier if I just put some code in the field of my report to hide it when its value is 0.

The problem is, I don't know where I would enter code like this on the report.  If I put it in the reports properties, it says that I have entered an expression that has no value.

It should be something like

If Me.LPAuditResultDetail1 = "0" Then
Me.LPAuditResultDetail1.Visible = True

Else
Me.LPAuditResultDetail1.visible = False

End If


Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of nico5038nico5038🇳🇱

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Thats my answer!

BTW - Is there a line I can put in that instead of setting the visible property to false that I can just tell it to not include the field at all?  (To avoid unsightly gaps in the report.)

Avatar of nico5038nico5038🇳🇱

No, when designed you only have this possibility.
One option is however to make the control as small as possible and set the CanGrow property to "Yes"
Thus when all fields on a detail line are treated this way an empty line almost as "nothing"

Nic;o)

:-)  Thanks!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.