Basically i have a report that is raised every thursday, in the title i want to specify the date for the friday. For example this week the report will be raised on the 3rd feb, when it is the title wnats to read "Report for ...... 04/02/2005. I know that this is simple enough however, sometimes the report maybe raised on any particular day of the week, but the title needs to show the date for the friday of the week concerned.
I have the code written in a module, as advised from a previous thread. The Code in the module is as follows;
Function WeekEndingFriday(AnyDate As Date) As Date
If Weekday(AnyDate) = vbMonday Then
WeekEndingFriday = AnyDate + 4
ElseIf Weekday(AnyDate) = vbTuesday Then
WeekEndingFriday = AnyDate + 3
ElseIf WeekEndingFriday = vbWednesday Then
WeekEndingFriday = AnyDate + 2
ElseIf Weekday(AnyDate) = vbThursday Then
WeekEndingFriday = AnyDate + 1
ElseIf WeekEndingFriday = vbFriday Then
WeekEndingFriday = AnyDate
Else
End If
End Function
I reference this module in my report, however when i open the report it asks me to enter the parameter value for <AnyDate>. But even when i do this it returns zero's. i want the report to open and just have the date for the friday of that week displayed without having to input a value
Help Please
!
I have the code written in a module, as advised from a previous thread. The Code in the module is as follows;
Function WeekEndingFriday(AnyDate As Date) As Date
If Weekday(AnyDate) = vbMonday Then
WeekEndingFriday = AnyDate + 4
ElseIf Weekday(AnyDate) = vbTuesday Then
WeekEndingFriday = AnyDate + 3
ElseIf WeekEndingFriday = vbWednesday Then
WeekEndingFriday = AnyDate + 2
ElseIf Weekday(AnyDate) = vbThursday Then
WeekEndingFriday = AnyDate + 1
ElseIf WeekEndingFriday = vbFriday Then
WeekEndingFriday = AnyDate
Else
End If
End Function
I reference this module in my report, however when i open the report it asks me to enter the parameter value for <AnyDate>. But even when i do this it returns zero's. i want the report to open and just have the date for the friday of that week displayed without having to input a value
Help Please