Results 1 to 3 of 3

Thread: DTPicker Question

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    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?
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    [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]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    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.
    "It's cold gin time again ..."

    Check out my website here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width