|
-
May 19th, 2005, 09:07 AM
#8
Re: Date validation
 Originally Posted by fadi_r
hi
you can use this code
VB Code:
Private Sub Text1_LostFocus()
Text1.Text = Format(Text1.Text, "dd/mm/yy")
End Sub
()
Fadi_r,
Using your code try entering the following value into Text1: 010101
You will see that the function returns: 27/08/1927
It returns 27/08/1927 because then this date is 10,101 days greater that 30/12/1899 which I believe is the base date that windows uses to determine the date.
But if you enter 01/01/01 or 01/0/2001 then it will return 01/01/2001.
But I agree with the others a Datepicker is the way to go!
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
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
|