|
-
Feb 16th, 2010, 08:17 PM
#1
Thread Starter
New Member
[RESOLVED] Compile Error when converting to date
Hi, to preface my question, I'm not very experienced in writing code so I wont understand complex answers.
The problem I am having is I am trying to convert a string to a date.
I am using the following code
Dim Current_Date As String
Dim D As Integer
Dim M As Integer
Dim Y As Integer
D = Current_Date.Substring(0, 2)
M = Current_Date.Substring(2, 2)
Y = Current_Date.Substring(4, 4)
MsgBox (CDate(D & M & Y))
End Sub
The problem is occuring when it gets to the D variable, the error says Compile error; Invalid qualifier.
Can anyone help?
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
|