PDA

Click to See Complete Forum and Search --> : Text Box???


jdaniels
Mar 13th, 2001, 09:47 AM
How do i limit the entrees of a textbox to just numbers and a decimal piont ????

Mar 13th, 2001, 01:56 PM
Try this:


Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc(".") Or KeyAscii = vbKeyBack Then Exit Sub
If Not (IsNumeric(Chr(KeyAscii))) Then KeyAscii = 0
End Sub