i'm still fixing my calculator and i've come across a problem. with my calculator, i want to disable any text and only allow numbers and ONLY one decimal to be typed in. this code is only for one radio button. i want it to work for all three that i have. can anyone help please?
Private Sub txtInvest_KeyPress(KeyAscii As Integer)
If KeyAscii < 32 Then Exit Sub
If Radio1.Value = True Then
If InStr("0123456789.", Chr$(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtRate_KeyPress(KeyAscii As Integer)
If KeyAscii < 32 Then Exit Sub
If Radio1.Value = True Then
If InStr("0123456789.", Chr$(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtTerm_KeyPress(KeyAscii As Integer)
If KeyAscii < 32 Then Exit Sub
If Radio1.Value = True Then
If InStr("0123456789.", Chr$(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
This post has been edited by firebolt94: 19 March 2009 - 02:05 AM

New Topic/Question
Reply



MultiQuote






|