

Private Sub txtCashTend_Change() If txtCashTend <> "" Then
txtCashTend.Text = Format(txtCashTend.Text, "###,###,##0.00")
starttext = Len(txtCashTend) - 3
txtCashTend.SelStart = starttext
End if
End Sub
txtCashTend.Text = Format(txtCashTend.Text, "###,###,##0.00")
starttext = Len(txtCashTend) - 3
txtCashTend.SelStart = starttext
End if
End Sub
untuk mencegah agar teks yang diketik tidak menerima input huruf tambahkan event text key press berikut
Private Sub txtCashTend_KeyPress(KeyAscii As Integer)
On Error Resume Next
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then
Beep
KeyAscii = 0
End If
End Sub
On Error Resume Next
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then
Beep
KeyAscii = 0
End If
End Sub