Hi there how do you check if a date entered into a text box is a valid entry......
We dont want to use a date picker because they look really odd in our program, any ideas?
Rohan
Printable View
Hi there how do you check if a date entered into a text box is a valid entry......
We dont want to use a date picker because they look really odd in our program, any ideas?
Rohan
Try this:
Hope this helps! ;)Code:Dim sDate As String
sDate = Text1.Text
If IsDate(sDate) then
'Enter wanted code here
End If
well, off the top of my head i would:
1. disallow the entry of letters with the use of isnumeric
2. check to make sure the propor format was entered
use instr to find 2 /'s
3. make sure the months are right
if month > 12 or month < 12
4. make sure the days are right
if days > 31 or days < 0 then
if Month = 3 then
if days > 28
hmm.. that should be about it...
damnit.. :D
What's wrong?
I think he forgot about the IsDate function.....
heh, ya, that's it, i just forgot about it... heh, damn only having one class of vb...