Long with value zero
Use the below condition...
If Clng("0" & Trim(Textbox1.value)) < 0 Then
''''
End If
If this post helps click Yes
---------------
Jacob Skaria
"Risky Dave" wrote:
Hi,
I have a form that captures user inputted values to text boxes and formats
them as numbers ("#,###,###"). These values are converted to numbers (using
CLng) and added in a Long variable. This bit works.
What I can't figure out is how to handle boxes that are not filled out -
which is an acceptable option for my users.
I have tried using an If statement to manually enter the value 0 (zero) if
the text box is empty (""), but the formatting just ignores it and keeps the
content blank (I have checked this by using a message box to display the
value held).
Can anyone suggest how I can convert a blank to a zero (this information is
stored elsewhere in the workbook as well so I would like to be able to
manipulate these as zero) in these circumstances?
Many thanks.
Dave
|