I have a form with a couple of controls on it including a frame. In this frame is a couple of textboxes where the user must enter some dates. I want to add error checking to this textboxes to make sure an incorrect/invalid date is not entered. I wanted to add error checking to the Control_Exit procedure to check for incorrect/invalid dates.
Problem: If I click in any one of the textboxes (all blank at this stage) other than the first textbox in the frame the first textbox Exit procedure is run and then the procedure crashes because there is no valid date in the first textbox. I can't even get to my error checking as it crashes before that (Runtime error 13. Type mismatch.). Even though this textbox was not selected at all
I tried changing the tabindex of the controls to make another textbox the first one and then it crashes on the new first textbox
Any idea why this is happening? Why would the Control_Exit procedure run without the control being selected first?
Bookmarks