#ERROR in Sub - Report
#ERROR in Sub - Report
(OP)
I am in need of much help here.... kind of new to sub-reports.
My main report works fine and I have the sub report linked fine.
The problem is when there are no records in the subreport
Ok I have a sub-report that the record source is a sql
SELECT id,count(datemailed) as DateLetterMailedOut
FROM tblProduct
WHERE ContactType = "Mail"
GROUP BY id;
and when there are records the text box is populated.
what I want to be able to do is when there are no records found to show
0 (Zero) as the count
I tried putting in the control source of the text box
=iif(isnull([DateLetterMailed]),0,[DateLetterMailed])
then I tried
=iif(isnull([DateLetterMailed]),"0",[DateLetterMailed])
then I tried
=iif(isnull([datemailed]),0,[datemailed])
and I tried
=iif(isnull([datemailed]),"0",[datemailed])
and none of these worked.....
If anyone knows what I am doing wrong or has another solution, PLEASE HELP!!!
Thanks
Andrew
My main report works fine and I have the sub report linked fine.
The problem is when there are no records in the subreport
Ok I have a sub-report that the record source is a sql
SELECT id,count(datemailed) as DateLetterMailedOut
FROM tblProduct
WHERE ContactType = "Mail"
GROUP BY id;
and when there are records the text box is populated.
what I want to be able to do is when there are no records found to show
0 (Zero) as the count
I tried putting in the control source of the text box
=iif(isnull([DateLetterMailed]),0,[DateLetterMailed])
then I tried
=iif(isnull([DateLetterMailed]),"0",[DateLetterMailed])
then I tried
=iif(isnull([datemailed]),0,[datemailed])
and I tried
=iif(isnull([datemailed]),"0",[datemailed])
and none of these worked.....
If anyone knows what I am doing wrong or has another solution, PLEASE HELP!!!
Thanks
Andrew
RE: #ERROR in Sub - Report
So try "Is null" as two words not one "isnull"
Second the quotes "" for the Zero are only needed if the DateLetterMailed field is a String. If its a number then you don't need quotes.
And Get the exact spelling of the field from the table or somewhere and paste it in the Windows clipboard or even in a Blank Notepad doc so you are 100% sure its spelled correct. And then paste it in your code by pressing Ctrl-C when you need to.
Also make sure that you infact have the DateLetterMailed field in your query if that what you are using.
DougP, MCP
dposton@universal1.com
Ask me how Bar-codes can help you be more productive.