Help, I need to caluculate values, but if the entry is blank I get an error. What is the best effective way to pervent blank entries or calulations to not bomb if error
I hope you use VB6.0 because this isn't working in 5.0
I use the validate event of a textbox to do what you are asking.
Try this
Private Sub Text1_Validate(Cancel As Boolean)
If Not IsNumeric(Text1) Then
MsgBox "Enter a numeric value please",vbExclamation
Cancel = True
End If
End Sub
I suppose the values that must be entered in the textbox must be numeric if you want to do calculations with them.
So this code works fine with both of the problems, numeric and empty.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.