How to create a text box that accepts as input data, only alphabetic and spaces ( for names of persons ).
I tried with KeyPress event but I can not control the keystrokes. More precisely, if a digit is pressed it's displayed in the text box and I don't want this.
e.g. code for txtPerson.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
If ( !ISALPHA(CHR(nKeyCode)) AND nKeyCode != 32 )
Messagebox('Use only alphabetic and spaces!')
EndIf
I tried with KeyPress event but I can not control the keystrokes. More precisely, if a digit is pressed it's displayed in the text box and I don't want this.
e.g. code for txtPerson.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
If ( !ISALPHA(CHR(nKeyCode)) AND nKeyCode != 32 )
Messagebox('Use only alphabetic and spaces!')
EndIf