Dim ctrLast As Integer
Dim tempSal As String
tempSal = Me.txtEmpSal.Value
'loop starting from end of string; replace latest dot /decimal point keyed in by user with blank
For ctrLast = Len(tempSal) To 1 Step -1
If Mid(tempSal, ctrLast, 1) = "." Then
tempSal = Replace(tempSal, Mid(tempSal, ctrLast, 1), "", ctrLast, 1)
Exit For
End If
Next ctrLast
Me.txtEmpSal.Value = tempSal
|