View Full Version : Removing #Error code...


rap1971
01-30-2001, 01:07 PM
I found a wonderful little piece of code to remove that nasty #Error in calculated text boxes...but I don't know where to put it to make it work.

I tried putting it in the default property...it's a function call

Function removeerror(testvalue As Variant) as Variant

If Not(IsNumeric(testvalue)) Then
removeerror=0
Else
removeerror=testvalue
End If

End Function

I have the Default property set to
=removeerror([txtbox])

Grrrrrrr.
I know when I dish this out to my staff and they see that #Error code they are going to freak...

Rich
01-30-2001, 01:28 PM
Why are the nasty error messages appearing?

rap1971
01-30-2001, 01:34 PM
The text box is a calculated field, dependent upon the values of other objects on the form (listboxes and comboboxes, etc.) Until all of the necessary boxes are filled with values, the calculation doesn't execute, therefore leaving me with #Error appearing in that box. End users don't like such things...I'd get a million phone calls..."It doesn't work! I'm getting errors!"