|
-
Jul 18th, 2001, 02:44 AM
#1
Thread Starter
Lively Member
Help!!! Type mismatch
Here is my code:
Dim DateD
DateStr = "July 17, 2001"
DateD = CDate(DateStr)
...
Running it VB reports a run time error Type Mismatch. What is wrong?
Best regards,
Oleksandr Valchyshen
A new one in VBA programming
http://www.art-capital.com.ua/?lang=english
-
Jul 18th, 2001, 03:02 AM
#2
New Member
When I use that code it works fine, is there some more, code, try hitting debug and it will find the faulty line
-
Jul 18th, 2001, 03:09 AM
#3
Thread Starter
Lively Member
I use bebug and the faulty line is
DateD = CDate(DateStr)
So, I cannot figure out what is wrong in code ...
Originally posted by write2slappy
When I use that code it works fine, is there some more, code, try hitting debug and it will find the faulty line
Best regards,
Oleksandr Valchyshen
A new one in VBA programming
http://www.art-capital.com.ua/?lang=english
-
Jul 18th, 2001, 03:12 AM
#4
New Member
Well, either send you program to [email protected] or post all your code , and i will exmaine it further
-
Jul 18th, 2001, 03:15 AM
#5
-= B u g S l a y e r =-
I bet vb doesn't consider this a date,
try MsgBox IsDate("July 17, 2001")
it will return false ...
-
Jul 18th, 2001, 03:16 AM
#6
-= B u g S l a y e r =-
MSDN Say the following:
CDate recognizes date formats according to the locale setting of your system. The correct order of day, month, and year may not be determined if it is provided in a format other than one of the recognized date settings. In addition, a long date format is not recognized if it also contains the day-of-the-week string.
hope this can help you solve your problem
-
Jul 18th, 2001, 03:38 AM
#7
Thread Starter
Lively Member
Thank you all for helping me.
VB really doesnot recognise "July 17, 2001" as a date, the following code returns false:
DateStr="July 17, 2001"
Msgbox IsDate(DateStr)
My computer system is set to Russian version of date presentation. In my code I try to convert a date string with Ukrainian date "name-of-month-in-ukrainian dd, yyyy" to american date type "mmm dd, yyyyy", in result of all convertions I'd like to have a date value like that "17/07/01".
Best regards,
Oleksandr Valchyshen
A new one in VBA programming
http://www.art-capital.com.ua/?lang=english
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
|