getting #ERROR

I am getting the #ERROR on (New) record line from the following IIF statement.  This is in the Control Source of a txtbox.  What you see below does give me the proper Y or N when needed but the #ERROR does not look good.  When I add NZ I get wrong number of arguments.  I know I am missing something but I really do not see it.  I am hoping a fresh set of eyes  can see the fix.



=IIf(DCount("PropertyInspectionFollowupID","tblPropertyInspectionFollowupAttachment","PropertyInspectionFollowupID=" & [PropertyInspectionFollowupID])>0,"Y","N")
billy bobAsked:
Who is Participating?
Gustav BrockConnect With a Mentor CIOCommented:
Try with

=IIf(DCount("*","tblPropertyInspectionFollowupAttachment","PropertyInspectionFollowupID=" & Nz([PropertyInspectionFollowupID],0) & "")>0,"Y","N") 

Open in new window

billy bobAuthor Commented:
The additional part worked like a charm.  Now the (New) line has a N after it, which is acceptable.  Mr Brock, thank you for your help on this.
Gustav BrockCIOCommented:
You are welcome!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.