|
-
Mar 18th, 2007, 11:35 AM
#1
Thread Starter
Hyperactive Member
DTPicker Question?
Hi,
In a form, I have a field that use DTPicker to let user select the date. How can I prevent the user pick the weekend (like sat, sun).
Thanks!
-
Mar 19th, 2007, 06:29 AM
#2
Re: DTPicker Question?
Code:
If Weekday(Text1.Text) = vbSunday Or Weekday(Text1.Text) = vbSaturday Then
MsgBox "The Date cannot be a Saturday or Sunday.", vbOKOnly + vbExclamation, "Invalid Date"
Text1.Text = vbNullString
Exit Sub
End If
-
Mar 19th, 2007, 07:06 AM
#3
Frenzied Member
Re: DTPicker Question?
Code:
If Weekday(dtPicker.Value) = vbSunday Or Weekday(dtPicker.Value) = vbSaturday Then
MsgBox "The Date cannot be a Saturday or Sunday.", vbOKOnly + vbExclamation, "Invalid Date"
dtPicker.Value = now()
Exit Sub
End If
Just modified Hack's to use the dtpicker. :P
-
Mar 19th, 2007, 08:23 AM
#4
Re: DTPicker Question?
 Originally Posted by Besoup
Code:
If Weekday(dtPicker.Value) = vbSunday Or Weekday(dtPicker.Value) = vbSaturday Then
MsgBox "The Date cannot be a Saturday or Sunday.", vbOKOnly + vbExclamation, "Invalid Date"
dtPicker.Value = now()
Exit Sub
End If
Just modified Hack's to use the dtpicker. :P
That was actually taken directly from one of my projects in which I use a dtpicker.
I changed the control names to make it more generic, but I think I generized it a bit too much.
Takes Besoup!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|