Jumat, 28 Februari 2014

[MS_AccessPros] How do I display a label caption only when the text box has a value (not null).

 

My report's  group footer has a label named "Total:" and a text box "txtTotal", which for displaying the sums of the [Amount] field in the detail line. The label "Total:" is visible on every group' footer even there's nothing (is null) to display. How do I display the label  "Total:" only when the text box has a value to show?

I tried this lines of code (F8, step through it), some how it executed at 1 time and it seems to work, then it's never run again. What is the correct way to do it?

Thank you

Phucon

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.txtTotal & "" = "" Then

     Me.lblTotal.Visible = False

Else

     Me.lblTotal.Visible = True

End If

End Sub

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
.

__,_._,___

Tidak ada komentar:

Posting Komentar