Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit U. S. Dollars

Status
Not open for further replies.

Bullfrog

MIS
Sep 21, 1999
7
0
0
US
Got kind of lost trying to Write my own Input-Edit For Dollars.<br>
Is there a Down load available ... Thanks <br>
<br>
<br>
<br>
<br>
<br>
<br>

 
What method are you using to do it?<br>
Inut mask ????<br>

 
'''' 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 = &quot; *&quot; Then ' a bypass note leading space<br>
GoTo Bypass<br>
End If<br>
If Mykash = &quot; 0&quot; Then ' a bypass note leading space<br>
GoTo Bypass<br>
End If<br>
<br>
If Mykash = Empty Then 'Req By Office <br>
MsgBox &quot;Insert value in amount&quot;<br>
badflag2 = &quot;yes&quot;<br>
GoTo Theend<br>
End If<br>
<br>
If Mykash = Null Then 'R B O<br>
MsgBox &quot;Insert value in amount&quot;<br>
Badflag = &quot;yes&quot;<br>
GoTo Theend<br>
End If<br>
<br>
If Mykash = &quot;&quot; Then 'R B O <br>
MsgBox &quot;Insert value in amount&quot;<br>
Badflag = &quot;yes&quot;<br>
GoTo Theend<br>
End If<br>
<br>
<br>
mycheck = IsNumeric(Mykash) ' Returns True if good number.<br>
If mycheck = False Then<br>
MsgBox &quot;Amount must be all numeric with one decimal point&quot;<br>
badflag2 = &quot;yes&quot;<br>
GoTo Theend<br>
End If<br>
<br>
<br>
Mypos = InStr(1, Mykash, &quot;.&quot;, vbTextCompare) 'GIVES POSITION OF FIRST &quot;.&quot;<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 &quot;Decimal Point not in correct position&quot;<br>
badflag2 = &quot;yes&quot; 'additional marker for errors<br>
GoTo Theend<br>
End If<br>
<br>
Enddecimal:<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top