I must be missing something basic, but I've never been able to figure out how to stop an event (say, a click event) that results after the user leaves a textbox with invalid data. I have all sorts of tricks for trapping the error during change events, but now I'm trying to validate email addresses, and that seems to demand validation during afterupdate.
However, if the user enters an invalid address (no @ or .) and proceeds to close the form by clicking a command button without tabbing out of the textbox first, the afterupdate validation will throw up the error message--and then the form closes anyway. I've tried using "End"; not only does that not work but programmers on this forum advise against it. So what am I missing?
However, if the user enters an invalid address (no @ or .) and proceeds to close the form by clicking a command button without tabbing out of the textbox first, the afterupdate validation will throw up the error message--and then the form closes anyway. I've tried using "End"; not only does that not work but programmers on this forum advise against it. So what am I missing?