Results 1 to 4 of 4

Thread: DateTimePicker Date Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    Hello
    I work with a DateTimePicker control and I want to control the date choosen by the user.

    The date must be today or later...

    Thank U for your help

  2. #2
    Hyperactive Member johnweidauer's Avatar
    Join Date
    Sep 2002
    Location
    SLC, UT
    Posts
    314

    selected date

    Not with VB right now, but do an OnUpdate or OnChange or a Timer to check that the date of the control is >= Date()

  3. #3
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Why not trap one of the events that the dtp produces. Like:
    VB Code:
    1. Private Sub dptMyDate_Change()
    2.    If dtpMyDate.Value < Date Then
    3.       MsgBox "NO BAD USER!"
    4.       dtpMyDate.Value = Date
    5.    End If
    6. End Sub
    Woka

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Set the MinDate property equal to today. The user will not be able to select or enter anything before then.

    VB Code:
    1. Private Sub Form_Load()
    2.    Me.DTPicker1.MinDate = Date
    3. End Sub

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