Getting #Error to not display

M

Matt Pierringer

Ok here it goes, I have a text box on my report and it is setup with
=DLookUp([Each],"qryRequiredEach","Required=" & [Required]) as source.
So it is very rare when it has a value... almost my report displays
#Error for this control but every time Required is used it will display
it. I am trying to find some way of either setting it 0 so that I can
set it to invisible or something with an If statement.

Thanks, I am probably taking the wrong approach as to fixing this :)
 
A

Allen Browne

Use Nz() to supply an unlikely value when the field is null, e.g.:
=DLookUp([Each], "qryRequiredEach", "Required = " & Nz([Required],0))

That should work unless the problem occurs when the report has no records.
In that case you need to use IIf() to test [Report].[HasData]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top