
Question about preventing certain input
i am working on a simple calculator and have it functionaly finished
no problem
I am using 2 text boxes for the input and a Command button to perform
the calculation (ie add, subtract, etc)
what i am trying to do is limit the input to numbers and the symbols
"." and "-", and also allow the use of backspace
the code i am using so far is;
Private Sub txtNum1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then KeyAscii = 8
If KeyAscii = Asc("-") Then KeyAscii = Asc("-")
If KeyAscii = Asc(".") Then KeyAscii = Asc(".")
If KeyAscii > Asc("9") Then _
End Sub
this managws to stop the use of letters but it still allows symbols
such as /, *, +, etc etc
What am i doing wrong or id there any easier way to code it.
It may be obvious that i am no expert so any help is greatly
appreciated thanx
-=*<{*filter*}ioN>*=-