-
With the DTPicker control, if you enter an invalid date and then move off of the control, the DTPicker will "correct itself" - i.e., it will revert back to the value it had before you entered the erroneous date. Fine. This is good.
However, how do I test whether or not this happened so that I can move focus back to the DTPicker if the user had entered a bad date?
-
<?>
[code]
Option Explicit
Public publicX As String
Private Sub DTPicker1_GotFocus()
publicX = DTPicker1.Value
End Sub
Private Sub DTPicker1_LostFocus()
If publicX <> DTPicker1.Value Then Exit Sub
'else whatever
MsgBox "Sorry, date is not valid"
End Sub
[code]
-
You gave me a good idea by saving the value in the GotFocus event. I'll play around with it and see if I can make it go. Thanks.