SitesMasstec
Programmer
In a form there are these text boxes:
[pre]
txtROR01 txtRCO01
| | | | ... more text boxes here
txtROR02 txtRCO02
| | | | ... more text boxes here
[/pre]
...
In each TextBox I have:
MyNumber=RIGHT(this.Name,2)
In the VALID procedure for txtROR01 , txtROR02 , I have:
[pre]
frase="thisform.Pageframe1.Page1.txtROR" + MyNumber + ".Value"
IF &frase<>"E" AND &frase<>"R" AND &frase<>" "
Messagebox("Type E or R",0, "Erro")
RETURN .F.
ELSE
RETURN .T.
ENDIF
[/pre]
When executed, if I type for example, A (invalid), instead of E or R (valid choices), the A is displayed in the txtROR01 TextBox and the cursor returns to txtRCO01 (instead of remainig in the txtROR01 TextBox!
I searched in this forum answers for this problem and I found for the error routine RETURN 0 or RETURN -1, instead of RETURN .F., and also Tab Order reassignment for the text boxes, but none of these solved my problem.
Why RETURN .F. is not returning to the same TextBox which has generated error (invalid character was typed)?
Thank you,
SitesMasstec