G
Guest
I am trying to use the "Year( #1/1/2005#)" Function where I replace the
"#1/1/2005#" value with a variable that is a date entered into a field called
[Start]. I have tried to define this variable as integer and and just about
every other data type there is, but I keep getting the "Type Mismatch"
message. the code looks like
Dim StartYear As Date
Dim x As Integer
StartYear = [Start] '[Start] is a "Date/Time" field
MsgBox ("StartYear = " & StartYear)
x = Year(StartYear)
MsgBox ("X is " & x)
I don't know what I am doing incorrectly, but for some reason I can't get
the thing to work.
Any help would be appreciated.
"#1/1/2005#" value with a variable that is a date entered into a field called
[Start]. I have tried to define this variable as integer and and just about
every other data type there is, but I keep getting the "Type Mismatch"
message. the code looks like
Dim StartYear As Date
Dim x As Integer
StartYear = [Start] '[Start] is a "Date/Time" field
MsgBox ("StartYear = " & StartYear)
x = Year(StartYear)
MsgBox ("X is " & x)
I don't know what I am doing incorrectly, but for some reason I can't get
the thing to work.
Any help would be appreciated.