I tried it again - this time I made sure the query upon
which the report was based returned some records.
It worked then. Your suggestion looks like it too
would work.
I'm a bit surprised at the error I was getting being a
2427 error: "You entered an expression that has no
value". If the report object's recordsource produces
no records, the Format event is still occuring. The
OnFormat code is running - that's what's producing
the error. But what's so wrong with the expression
that this error occurs when no records are returned?
Even if I change the problem line to read...
If Nz(Me!ThreeBucks, 0) = True Then Me!ThreeDollarRansomNote.Visible =
True Else Me!ThreeDollarRansomNote.Visible = False
.... I still get the same error! What's with that? So what?
The value in the damned textbox ain't True, it ain't False
and it apparently ain't Null either. Otherwise - why would
Access report this error?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mon, 7 Jan 2008 14:39:16 -0800 (PST), Lauren Quantrell
<la*************@hotmail.comwrote:
>You must put this in the OnFormat of the Detail section of the report:
Private Sub Detail_Format(cancel As Integer, FormatCount As Integer)
On Error GoTo myErr
'>set icon:
If Len(Me!myDataName) 0 Then
Me.ImageName.Visible = True
Else
Me.ImageName.Visible = False
End If
myExit:
Exit Sub
myErr:
MsgBox Err.Number & "-" & Err.Description
Resume myExit
End Sub