A good solution is to use the Error Provider control.
You must have at least two controls on the form in order to tab between them and thereby invoke the validation code.
For example a user is filling in data and he inputs something incorrect in a field, but he then quickly wants to close the window by pushing X in the upper right corner.
At the moment validation goes off and show a dialogbox that incorrect data is enterred when I press X.
I.e., the caret will remain in the textbox until the user enters the correct format.
Important: Never attempt to set the Focus of a control in this event because it can cause the script to hang.
I have a form with numerous textboxes and I use the validating event to validate these items.