'''' Try this as a private sub .....Click <br>
Dim Mykash, MyCurr, mycheck<br>
Dim answ, test, Mypos<br>
Dim Dpoint<br>
Dim mylen<br>
''''''''' Badflag is in module1.bas as a global<br>
<br>
''''''This is a slice out of a larger Effort<br>
<br>
Mypos = 0<br>
Mykash = Amount.Text 'Puts Entry into Mykash<br>
If Mykash = " *" Then ' a bypass note leading space<br>
GoTo Bypass<br>
End If<br>
If Mykash = " 0" Then ' a bypass note leading space<br>
GoTo Bypass<br>
End If<br>
<br>
If Mykash = Empty Then 'Req By Office <br>
MsgBox "Insert value in amount"<br>
badflag2 = "yes"<br>
GoTo Theend<br>
End If<br>
<br>
If Mykash = Null Then 'R B O<br>
MsgBox "Insert value in amount"<br>
Badflag = "yes"<br>
GoTo Theend<br>
End If<br>
<br>
If Mykash = "" Then 'R B O <br>
MsgBox "Insert value in amount"<br>
Badflag = "yes"<br>
GoTo Theend<br>
End If<br>
<br>
<br>
mycheck = IsNumeric(Mykash) ' Returns True if good number.<br>
If mycheck = False Then<br>
MsgBox "Amount must be all numeric with one decimal point"<br>
badflag2 = "yes"<br>
GoTo Theend<br>
End If<br>
<br>
<br>
Mypos = InStr(1, Mykash, ".", vbTextCompare) 'GIVES POSITION OF FIRST "."<br>
<br>
<br>
mylen = Len(Mykash) ' gives length of Mykash<br>
answ = mylen - Mypos ' gives position of decimal point<br>
If Not answ = 2 Then ' two positions for US currency<br>
MsgBox "Decimal Point not in correct position"<br>
badflag2 = "yes" 'additional marker for errors<br>
GoTo Theend<br>
End If<br>
<br>
Enddecimal:<br>
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.