>Tim, If this is something your trying to avoid, I think you'll run into the same problem using setfocus(). Perhaps all you need to do is enable/disable controls allowing the user to continue only when a valid entry has been made. This would still enable the control being checked to lose focus and the quit button would be able to be clicked.
Ken,Not sure what you're saying there. But are you saying there isn't a way to allow the user to quit regardless of what he's entered into the textbox?
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."