This allows you to check in real-time if the data in a text box is a valid integer, and will not le
This allows you to check in real-time if the data in a text box is a valid integer, and will not let you type in anything other than an
API Declarations
Dim xCount As Integer
Rate This allows you to check in real-time if the data in a text box is a valid integer, and will not le
(1(1 Vote))
xPeriod = 0
If strDefValue = "" Then
xDefValue = 0
Else
For xCount = 1 To Len(strDefValue)
If Asc(Mid(strDefValue, xCount, 1)) <= 57 And Asc(Mid(strDefValue, xCount, 1)) >= 48 Or Asc(Mid(strDefValue, xCount, 1)) = 46 Then
If Asc(Mid(strDefValue, xCount, 1)) = 46 Then
xPeriod = xPeriod + 1
If xPeriod > 1 Then
strDefValue = Left(strDefValue, xCount - 1) & Right(strDefValue, Len(strDefValue) - xCount)
End If
End If
Else
strDefValue = Left(strDefValue, xCount - 1) & Right(strDefValue, Len(strDefValue) - xCount)
End If
Next xCount
End If
If strDefValue = "" Then
xDefValue = 1
strDefValue.Text = 1
End If
If Len(strDefValue.Text) = 1 Then
If Asc(Left(strDefValue.Text, 1)) = 46 Then
strDefValue = 1
xDefValue = 1
End If
End If
End Sub
This allows you to check in real-time if the data in a text box is a valid integer, and will not le Comments
No comments yet — be the first to post one!
Post a Comment