Good day!
I have a variable string that will hold numbers...I need a function that will check if the number meets the below criteria:
( Acceptable format )
-accept positive numbers
-accept negative numbers
-accept single decimal place (ex. 567.89)
-will not accept double demical place (ex. 567.89.678)
-will not accept single, double positive sign after a digit(ex. 98+45+)
-will not accept single, double negative sign after a digit(ex.34-, 98-45-)
<A little code demonstration>
Public Function Validate_Number(ByRef PassNumber as String) as Boolean
'formatting conditions here
End Function
Private Sub TxtInputNumber_LostFocus()
If Validate_Number(TxtInputNumber.Text)=True Then
msgbox "The Number is in Acceptable Format",vbInformation
else
msgbox "The Number is Not an Acceptable Format",vbInformation
End Sub
I dont want to use masking as this is the required format to follow.
Thank you for helping!