Click to See Complete Forum and Search --> : DateTimePicker Date Control
Fisherman
Nov 24th, 1999, 02:40 PM
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
johnweidauer
Dec 24th, 2003, 02:11 AM
Not with VB right now, but do an OnUpdate or OnChange or a Timer to check that the date of the control is >= Date()
Wokawidget
Dec 24th, 2003, 03:00 AM
Why not trap one of the events that the dtp produces. Like:
Private Sub dptMyDate_Change()
If dtpMyDate.Value < Date Then
MsgBox "NO BAD USER!"
dtpMyDate.Value = Date
End If
End Sub
Woka
brucevde
Dec 24th, 2003, 11:36 AM
Set the MinDate property equal to today. The user will not be able to select or enter anything before then.
Private Sub Form_Load()
Me.DTPicker1.MinDate = Date
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.