why the code not itercept error in if not is date!!!!
in my case i need to force the user to digit correct date in this format: dd/mm/yyyy
i text box have: 15/11/980
see image!
check if date is valid
-
- PlatinumLounger
- Posts: 4334
- Joined: 26 Apr 2010, 17:36
check if date is valid
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 12577
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: check if date is valid
I guess that doesn't generate an error because it is a date, 15th November in the year 980
StuartR
-
- Administrator
- Posts: 78237
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: check if date is valid
Use
Code: Select all
If Not Me.TDATANASCITA.Text Like "##/##/####" Then
...
Exit Sub
End If
If Not IsDate(Me.TDATANASCITA.Text) Then
...
Exit Sub
End If
...
Best wishes,
Hans
Hans