I have a piece of code that is giving me problems using the Year() function. I get an error telling me that an array was expected. I have looked at several examples and it appears I am using it correctly. This is a condensation of the code I am having problems with.
the line - YearToView = Year(DateToView) seems to be where I get the "expected array" error.
Am I doing something wrong...does anyone have any ideas.
Thanks
(I can post the entire code if it would help)
Code:
Public Function IsDST(Year As String) As Boolean
IsDST = False
Dim DateToView As Date
Dim BeginDate As Date
Dim EndDate As Date
Dim MonthToView As Integer
Dim YearToView As Integer
Dim DayToView As Integer
Dim CheckDay As Integer
DateToView = StartDate
MonthToView = 4
[b]YearToView = Year(DateToView)[/b]
DayToView = 1
*
*
*
*
If (DateToView > EndDate) Or (DateToView < BeginDate) Then IsDST = True
End Function
the line - YearToView = Year(DateToView) seems to be where I get the "expected array" error.
Am I doing something wrong...does anyone have any ideas.
Thanks
(I can post the entire code if it would help)