Converting to string

szymek_d

Registered User.
Local time
Today, 06:29
Joined
May 26, 2005
Messages
21
can anyone in the world thell me why this doesn't work???

Dim temp As String
temp = CStr(Year(Now()))

I get type mismatch error. why??
i created new form and tried it there... and it works.. but when i plug it into the form where i need it i get an error.

i'm just trying to extract current year and convert it to string.
 
Don't know why it won't work for you but the following would be simpler.

Code:
Dim temp As String
temp = Format(Date, "yyyy")
 
Now it works.

Thank you!
 

Users who are viewing this thread

Back
Top Bottom