×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

#ERROR in Sub - Report

#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

RE: #ERROR in Sub - Report

Well one clue that the syntax is wrong is when it does not capitalize the "I" in Iff

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close