williamlove
Registered User.
- Local time
- Yesterday, 16:23
- Joined
- Feb 9, 2006
- Messages
- 37
I want to get the year, so I tried this:
Dim vYear As Variant
vYear = Year(Date)
When I run this I get run time error 13, type mismatch.
To sort this out, I tried running this sample code, straight out of the help.
Dim MyDate, MyYear
MyDate = #February 12, 1969# ' Assign a date.
MyYear = Year(MyDate)
When I run this I still get run time error 13, type mismatch.
I also tried this
Dim vYear As Variant
vYear = Year(#11/24/2007#)
and
vYear = Year("11/24/2007")
Still the type mismatch. I'm stumped. Can you identify the problem? I am running Access 2003 on a fully patched and updated XP Pro box.
Dim vYear As Variant
vYear = Year(Date)
When I run this I get run time error 13, type mismatch.
To sort this out, I tried running this sample code, straight out of the help.
Dim MyDate, MyYear
MyDate = #February 12, 1969# ' Assign a date.
MyYear = Year(MyDate)
When I run this I still get run time error 13, type mismatch.
I also tried this
Dim vYear As Variant
vYear = Year(#11/24/2007#)
and
vYear = Year("11/24/2007")
Still the type mismatch. I'm stumped. Can you identify the problem? I am running Access 2003 on a fully patched and updated XP Pro box.