>Where is the best place to validate user input ? I used (FPW 2.6) to make validations in the "When" event of the "Ok"/"Save" button, but I can't set the focus back to the right control.
>
>What is your opinion about this ?
I run a CheckValid method when Save is clicked to check for everything. I create a global array to hold error messages (validation failure, not system errors) and matching controls. If there are any validation failures I set a form ValidErrors property to TRUE. I then show a modal form listing all validation failures with an OK button. When they hit OK and focus returns to the calling form, if the ValidErrors property is TRUE, I use form.control.SetFocus() to the first control in the array.
I just don't like using LostFocus or Valid for anything but very rudimentary checking, such as blanks and such.
Just my thoughts.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05