I have one textbox (Textbox1). When focus is lost, a data verification for a date (European (dd/mm/yy)) takes place:
Private Sub TextBox1_LostFocus()
If Not IsDate(TextBox1.Text) Then MsgBox "Not a valid date" Else MsgBox "Valid date"
Entering 12/12/09 - Valid Date (ie, 12 December 2009)
Entering abc - Not a valid date
Entering 01/08/09 - Valid Date (ie, 01 Aguust 2009)
Entering 14/13/09 - Not a valid date (ie, 14th day of the 13th month 2009)
Unfortunately, when I enter 01/13/09 (ie, the first day of the thirteenth month 2009), it said Valid date. Another example includes a data entry 09/22/09 which should have been entered 22/09/09 so when I run a report for September, it does not pick up 22 as a month and the data is lost.
The Isdate function does not appear to consider the regional setting of the computer (mine is set to Brisbane Australia using dd/mm/yy - no issues there).
I'm a bit lost as to how to fix it. Any ideas?