Getting #Error to not display

  • Thread starter Thread starter Matt Pierringer
  • Start date Start date
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 :)
 
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]
 
Back
Top