Ken,
The first line of code I put in worked wonderful. But the second will not.
I am not very good with code. My label is Setup_Fee_Label and the field is
Setup Fee
But I keep getting an unexpected end to the statement.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Setup_Fee_Label.Visible = Me.Setup Fee <> 0
End Sub
My next variable is:
Hour (Rate 1)_Label and the control is Hour (Rate 1)
Thanks again.
If you use blanks or special characters in control names, you MUST enclose the
names in square brackets. Blanks are meaningful! Me.Setup Fee in VBA is two
values - Me.Setup, and a meaningless word Fee.
Try
Me.Setup_Fee_Label.Visible = Me.[Setup Fee] <> 0
Similarly, when your code refers to any other control with such names, enclose
the name in brackets.
I've had some wierd things happen with field and control names containing
parentheses, even *with* brackets - I'd suggest avoiding such names. The user
will never need to see fieldnames or control names, so you may be better off
with a naming convention that uses only letters, numbers and underscores in
control names - e.g. a fieldname Hour_Rate1 (note that Hour is a reserved
word!!) would be bound to a textbox named txtHour_Rate1 with a label named
lblHour_Rate1.
John W. Vinson [MVP]