Hi,
i am trying to code a event to prevent certain keystrokes in a refedit window in my form.
However it does not work for my refedit (but it does for my textbox) and i do not know why.
Private Sub RefEdit1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 48 To 57
Case 44
If InStr(1, RefEdit1.Text, ",") > 0 Then KeyAscii = 0
Case Else
KeyAscii = 0
End Select
End Sub
Here is a sample of the code i use with Excel 2010. Maybe you know why it does not work or if there is another way
to solve my problem. As i said the exact same code works perfect for textboxes which are used with the parameters:
textbox1_Keypress(Byval Keyascii as MSForms.ReturnInteger)
Best Regards from germany
Sodonikus
i am trying to code a event to prevent certain keystrokes in a refedit window in my form.
However it does not work for my refedit (but it does for my textbox) and i do not know why.
Private Sub RefEdit1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 48 To 57
Case 44
If InStr(1, RefEdit1.Text, ",") > 0 Then KeyAscii = 0
Case Else
KeyAscii = 0
End Select
End Sub
Here is a sample of the code i use with Excel 2010. Maybe you know why it does not work or if there is another way
to solve my problem. As i said the exact same code works perfect for textboxes which are used with the parameters:
textbox1_Keypress(Byval Keyascii as MSForms.ReturnInteger)
Best Regards from germany
Sodonikus