G
Guest
Hi there,
I have a form that requires the user to enter two dates where the first must
be before the second. I only want to validate the dates when the user clicks
the OK button.
I've tried using the validating events but the best I was able to accomplish
was to have the validating event fire for the group box that contains the
date entry controls. The problem that occurs then is that the event fires
because the user clicked on the OK button. That seems to cancel out the OK
click and you have to click OK again.
I then tried to do the validation during the OK button clicked event.
Unfortunately, I can't figure out how to cancel the click event if there is a
problem with the date. I'm able to pop up an error message, but then it just
continues to close down the form and return to the calling form. Is there a
clean way to do it?
Thanks,
Carlo.
I have a form that requires the user to enter two dates where the first must
be before the second. I only want to validate the dates when the user clicks
the OK button.
I've tried using the validating events but the best I was able to accomplish
was to have the validating event fire for the group box that contains the
date entry controls. The problem that occurs then is that the event fires
because the user clicked on the OK button. That seems to cancel out the OK
click and you have to click OK again.
I then tried to do the validation during the OK button clicked event.
Unfortunately, I can't figure out how to cancel the click event if there is a
problem with the date. I'm able to pop up an error message, but then it just
continues to close down the form and return to the calling form. Is there a
clean way to do it?
Thanks,
Carlo.