Where are you putting this code?
It needs to be in Form_Current (If Not Me.NewRecord) _and_ in the
Textbox's AfterUpdate Event. The Form_Current code should look like:
If Me.NewRecord Or IsNull([Text377]) Then
Label30.Visible = False
Else
Label30.Visible = ([Text377] < 0)
End If
The Text377_AfterUpdate code should look like:
If IsNull([Text377]) Then
Label30.Visible = False
Else
Label30.Visible = ([Text377] < 0)
End If
In both cases, you don't know the initial state of Label30, so you
need _explicitly_ to make it either Visible or inVisible, depending on
the value of [Text377], and it is good practice to handle the Null
case explicitly before you do numeric operations on the contents of a
field or Textbox. You don't need to do this if [Text377] is a Required
Field (and so can't be Null).
I have a Textbox and a Label on my main form.
If the Textbox value is a negative number, i.e. (format Currency) then
Label30 needs to be visible, tried code below but with no results,
What am I doing wrong?
If ([Text377]) < 0 Then
Label30.Visible = True
End If
Please respond to the Newsgroup, so that others may benefit from the
exchange.
Peter R. Fletcher