SET CONFIRM ON means enforcing the use of ENTER. You can't have SET CONFIRM ON and not want its restriction. That's nonsense.
SET CONFIRM OFF and you can tab and use arrow keys again.
If you want any more specific behaviour, you have the VALID event and can control when and when not to Return .T., you can enforce staying in the current control by RETURN .F. or RETURN 0, which IIRC differs in either showing or not showing a message of "invalid input", so you can even control that part of the behaviour.
Just a sidenote, as you mention Textbox and not Editbox, but due to TAB being a valuable text formatting, the editbox behaviour can be changed via .AllowTabs property.
I also think we had a lengthy thread here about the idea of changing control behaviour via Keypress code. Tamar is right on that, I would not recommend to have too much in there, as it will hardly be maintainable even for yourself one year later.
For example we solved the case to prevent BACKSPACE deleting more than the current textbox in thread184-1654550
Searching for Keypress here in the tek-tips search might find something for whatever your reason to allow some and not other keys.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.