G
Guest
Our fiscal year starts 7/1. Currently it is fiscal year 2005, but on 7/1 it
will be fiscal year 2006. I am trying to write a simple function that will
figure out what fiscal year we are in. I have my current function attached to
many queries and forms to automatically set the year for my users.
I have noticed a flaw in my code. It seems to work right for all months
except 10, 11 and 12 (Oct-Dec). I think I am missing something easy here,
either with what I have or via another way to do this calculation.
Any help would be greatly appreciated.
Public Function FigureBudgetYear() As String
If Format(Date, "m/d") > "6/30" Then
FigureBudgetYear = Format(Date, "yyyy") + 1
Else
FigureBudgetYear = Format(Date, "yyyy")
End If
End Function
Thanks in advance,
Clint
will be fiscal year 2006. I am trying to write a simple function that will
figure out what fiscal year we are in. I have my current function attached to
many queries and forms to automatically set the year for my users.
I have noticed a flaw in my code. It seems to work right for all months
except 10, 11 and 12 (Oct-Dec). I think I am missing something easy here,
either with what I have or via another way to do this calculation.
Any help would be greatly appreciated.
Public Function FigureBudgetYear() As String
If Format(Date, "m/d") > "6/30" Then
FigureBudgetYear = Format(Date, "yyyy") + 1
Else
FigureBudgetYear = Format(Date, "yyyy")
End If
End Function
Thanks in advance,
Clint