Topic: Force numeric input

Hello Again Dmitry,

I have a script to force numeric entry.

procedure form6_Edit1_OnKeyPress (Sender: string; var Key: Char);
  begin
    if not (Key in ['0'..'9']) then Key:=#0;
  end;

This works as it should and only allows 0-9. 
However, if you make a mistake entering data (for example, enter '1234' instead of '5678'), it is not possible to use the 'backspace' key;  instead, you must use the 'left arrow' key to move the cursor to where the mistake is and then use the 'delete' key.
Is there a fix for this?

Thanks,
Derek.

Re: Force numeric input

Hello,


Why you don't use property NumbersOnly?
http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=576&download=0

Dmitry.