[AccessD] Conditional Display of TextBox in Report Detail

Gustav Brock gustav at cactus.dk
Thu Mar 13 10:21:00 CST 2003


Hi Lawrence

You need to set it for every detail.
Try this:

      Me.Difference.Visible = (Me.Difference <> 0)

/gustav


> Using Access XP. I calculated field in the detail section of a report
> that compares an invoice amount with a check amount. I'd like the
> textbox to display if the value of the textbox does not equal zero. I've
> tried to use the following code in the "OnFormat" property of the detail
> section:

> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> On Error GoTo ERR_OnFormat

>     If Me.Difference = 0 Then
>         Me.Difference.Visible = False
>     End If

> Exit_ERR_OnFormat:
>     Exit Sub
    
> ERR_OnFormat:
>     MsgBox Err.Description
>     Resume Exit_ERR_OnFormat

> End Sub

> This code correctly detects the first textbox where the value <>0, but
> doesn't find any others (I've checked, and I should have a couple of
> other textboxes displaying).




More information about the AccessD mailing list