A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Null Value



 
 
Thread Tools Display Modes
  #11  
Old May 16th, 2005, 08:40 PM
BarryC
external usenet poster
 
Posts: n/a
Default

=IIf([Reports]![steve current month1].HasData,[Reports]![steve current
month1]![countOfControllers],0)

This is the control source for the text box on the main report. The sub
report is named "steve current month1" and the text box on the sub report is
named "countofcontrollers".

"Duane Hookom" wrote:

Could you provide the exact expression you use as the control source? Did
you change the names in the expression to match your actual names?

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, the main report is the problem. I have tried inserting a text box
with
the controll source IIF(subRpt.HasData...) All I get is the #NAME? error
message.

"Duane Hookom" wrote:

The IIf() expression should be in the main report, not the subreport.
Isn't
the main report where you are having the problem?

--
Duane Hookom
MS Access MVP


"BarryC" wrote in message
...
Duane,

Sorry, still not getting it. I have the IIF statement in my sub report.
The
sub report works fine by itself. When I insert it into my main report
it
does
not show when the value is null. When there is a value in the sub
report
it
works fine.

"Duane Hookom" wrote:

In the control source where you want to display a total from the
subreport
or a 0. It would be something like:
=IIf(sbrptA.Report.HasData,sbrptA.Report.txtSum,0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, that is what I want to do. Where on the main report would I
include
the
IIF() function?

"Duane Hookom" wrote:

Tricks for what? Do you want to show something on your main report
if
there
are no records in the subreport? If so, try the IIf() function with
a
reference to the HasData of the subreport.

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
news Thanks Duane,

=IIF(hasdata,count(*),0) is working. It is on a sub report in the
footer.
My
master report shows blank when the value is zero? Know any
tricks?
Thanks.

Barry

"Duane Hookom" wrote:

Comes up where? Do you have a control source that you would like
to
share?
The normal method is to ignore any posts that suggest using Nz()
since
they
won't work. Then set your control source to something like:

=IIf([HasData]=True, Sum(Qty), 0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
If a sql statment returns no records how do I have a text box
express
0.
The
"#error" comes up when no records are found.















  #12  
Old May 16th, 2005, 10:38 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

You messed up my expression by putting the cart in front of the horse
(report in front of subreport control name). Try:

=IIf([steve current month1].[Report].HasData,[steve current
month1].Report![countOfControllers],0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
=IIf([Reports]![steve current month1].HasData,[Reports]![steve current
month1]![countOfControllers],0)

This is the control source for the text box on the main report. The sub
report is named "steve current month1" and the text box on the sub report
is
named "countofcontrollers".

"Duane Hookom" wrote:

Could you provide the exact expression you use as the control source? Did
you change the names in the expression to match your actual names?

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, the main report is the problem. I have tried inserting a text box
with
the controll source IIF(subRpt.HasData...) All I get is the #NAME?
error
message.

"Duane Hookom" wrote:

The IIf() expression should be in the main report, not the subreport.
Isn't
the main report where you are having the problem?

--
Duane Hookom
MS Access MVP


"BarryC" wrote in message
...
Duane,

Sorry, still not getting it. I have the IIF statement in my sub
report.
The
sub report works fine by itself. When I insert it into my main
report
it
does
not show when the value is null. When there is a value in the sub
report
it
works fine.

"Duane Hookom" wrote:

In the control source where you want to display a total from the
subreport
or a 0. It would be something like:
=IIf(sbrptA.Report.HasData,sbrptA.Report.txtSum,0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, that is what I want to do. Where on the main report would I
include
the
IIF() function?

"Duane Hookom" wrote:

Tricks for what? Do you want to show something on your main
report
if
there
are no records in the subreport? If so, try the IIf() function
with
a
reference to the HasData of the subreport.

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
news Thanks Duane,

=IIF(hasdata,count(*),0) is working. It is on a sub report in
the
footer.
My
master report shows blank when the value is zero? Know any
tricks?
Thanks.

Barry

"Duane Hookom" wrote:

Comes up where? Do you have a control source that you would
like
to
share?
The normal method is to ignore any posts that suggest using
Nz()
since
they
won't work. Then set your control source to something like:

=IIf([HasData]=True, Sum(Qty), 0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
If a sql statment returns no records how do I have a text
box
express
0.
The
"#error" comes up when no records are found.

















  #13  
Old May 16th, 2005, 11:10 PM
BarryC
external usenet poster
 
Posts: n/a
Default

Got it. Thanks Duane.

"Duane Hookom" wrote:

You messed up my expression by putting the cart in front of the horse
(report in front of subreport control name). Try:

=IIf([steve current month1].[Report].HasData,[steve current
month1].Report![countOfControllers],0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
=IIf([Reports]![steve current month1].HasData,[Reports]![steve current
month1]![countOfControllers],0)

This is the control source for the text box on the main report. The sub
report is named "steve current month1" and the text box on the sub report
is
named "countofcontrollers".

"Duane Hookom" wrote:

Could you provide the exact expression you use as the control source? Did
you change the names in the expression to match your actual names?

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, the main report is the problem. I have tried inserting a text box
with
the controll source IIF(subRpt.HasData...) All I get is the #NAME?
error
message.

"Duane Hookom" wrote:

The IIf() expression should be in the main report, not the subreport.
Isn't
the main report where you are having the problem?

--
Duane Hookom
MS Access MVP


"BarryC" wrote in message
...
Duane,

Sorry, still not getting it. I have the IIF statement in my sub
report.
The
sub report works fine by itself. When I insert it into my main
report
it
does
not show when the value is null. When there is a value in the sub
report
it
works fine.

"Duane Hookom" wrote:

In the control source where you want to display a total from the
subreport
or a 0. It would be something like:
=IIf(sbrptA.Report.HasData,sbrptA.Report.txtSum,0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, that is what I want to do. Where on the main report would I
include
the
IIF() function?

"Duane Hookom" wrote:

Tricks for what? Do you want to show something on your main
report
if
there
are no records in the subreport? If so, try the IIf() function
with
a
reference to the HasData of the subreport.

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
news Thanks Duane,

=IIF(hasdata,count(*),0) is working. It is on a sub report in
the
footer.
My
master report shows blank when the value is zero? Know any
tricks?
Thanks.

Barry

"Duane Hookom" wrote:

Comes up where? Do you have a control source that you would
like
to
share?
The normal method is to ignore any posts that suggest using
Nz()
since
they
won't work. Then set your control source to something like:

=IIf([HasData]=True, Sum(Qty), 0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
If a sql statment returns no records how do I have a text
box
express
0.
The
"#error" comes up when no records are found.


















  #14  
Old August 14th, 2007, 04:06 PM posted to microsoft.public.access.reports
Johnny Bright
external usenet poster
 
Posts: 16
Default Null Value

Duane, you rock! I had the same problem and thanks to your posting, I no
longer have a problem! I'm sure glad I did a search of past postings!
--
www.brightfuture.ca/bright
My email address can be found on my site.


"Duane Hookom" wrote:

In the control source where you want to display a total from the subreport
or a 0. It would be something like:
=IIf(sbrptA.Report.HasData,sbrptA.Report.txtSum,0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
Yes, that is what I want to do. Where on the main report would I include
the
IIF() function?

"Duane Hookom" wrote:

Tricks for what? Do you want to show something on your main report if
there
are no records in the subreport? If so, try the IIf() function with a
reference to the HasData of the subreport.

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
news Thanks Duane,

=IIF(hasdata,count(*),0) is working. It is on a sub report in the
footer.
My
master report shows blank when the value is zero? Know any tricks?
Thanks.

Barry

"Duane Hookom" wrote:

Comes up where? Do you have a control source that you would like to
share?
The normal method is to ignore any posts that suggest using Nz() since
they
won't work. Then set your control source to something like:

=IIf([HasData]=True, Sum(Qty), 0)

--
Duane Hookom
MS Access MVP
--

"BarryC" wrote in message
...
If a sql statment returns no records how do I have a text box
express
0.
The
"#error" comes up when no records are found.









 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I achieve this? Jim Franklin Using Forms 5 April 16th, 2005 11:57 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Need someone to look at SQL statement Dkline Running & Setting Up Queries 4 August 3rd, 2004 05:12 PM
"UNION" Query with different fields in the two tables Dkline Running & Setting Up Queries 5 July 30th, 2004 09:05 PM
Access inconsistencies Hoopie Running & Setting Up Queries 2 June 15th, 2004 10:53 AM


All times are GMT +1. The time now is 04:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.