Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Report ISNULL field 1

Status
Not open for further replies.

GShen

MIS
Sep 26, 2002
561
US
Hi,
A few weeks ago I posted a question as to how to get data from a sub report back to a main report. It works fine. However, there are times when the subreport does not bring back any data, therefore, the number I am using for a calculation does not exist and I get an error. I tried using the IIF and ISNULL but it is not working. See below

=IIf(IsNull([RptReclamationStoreDetailSubType2And3].[Report].[txtType2And3Qty]),0,1)

I am always getting the "1" condition whether I have data or not. Obviously I want to replace the 1 with
([RptReclamationStoreDetailSubType2And3].[Report].[txtType2And3Qty] when I am done but I am just trying to keep it simply.

What am I doing wrong? I am losing it and it is only Tuesday.
Thanks,



Remember when... everything worked and there was a reason for it?
 
are you sure you can reference the value of the text box on the report that way?

are you just testing if that 1 text box has a value or are you trying to test if the report has ANY data at all?

if you're trying to find out if the report has ANY data, then try using the report.recordset.countrecords

--------------------
Procrastinate Now!
 
Try something like:

=IIf([RptReclamationStoreDetailSubType2And3].[Report].HasData,[RptReclamationStoreDetailSubType2And3].[Report].[txtType2And3Qty]),0)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane,
Thanks again! The only thing I had to change was the HasData to [HasData]. It needed brackets.
I am done. ........suddenly my headache went away. :)


Remember when... everything worked and there was a reason for it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top