Date on my report HELP !!

Jaspal

Jas
Local time
Today, 23:08
Joined
Dec 31, 2004
Messages
38
hi there i hope that you can help with this.

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 :eek:

Any help would be much appriciated !
 
Last edited:
Custom Function in Module

Write the Custom function in a module, insert in Report control to reference
the report date, whereever that resides. I did no t figure out Saturdays or sundays for you, don't know if you want to trap that as an error, or reports are valid.


Function WeekendingFriday(anyDate As Date) As Date

If Weekday(anyDate) = vbMonday Then
WeekendingFriday = anyDate + 4
ElseIf Weekday(anyDate) = vbTuesday Then
WeekendingFriday = anyDate + 3
ElseIf Weekday(anyDate) = vbWednesday Then
WeekendingFriday = anyDate + 2
ElseIf Weekday(anyDate) = vbThursday Then
WeekendingFriday = anyDate + 1
ElseIf Weekday(anyDate) = vbFriday Then
WeekendingFriday = anyDate
Else

End If


End Function


sportsguy
 
Ill try that

Cheers for that, ill try doing that and see how is goes! I dont need weekend days so thats ok.

Let you know how i get on !
 
Me again!

right ive written the code in a new module but im unsure were in the report or the report properties to reference the modue. Please could someone please tell me how i can refernce a module for the results to show in a report. By the way im bit of a newbee to access and vba

thanks
 
Ive wriiten the module that i have been advised to write, which is fine and referenced the function in the required text box in my report.

However when i open the report its asks me to enter the Parameter value for <AnyDate>. I want the report to open and from the code to calculate the date for the friday of that week !

Please Help :confused:
 
:rolleyes:

However when i open the report its asks me to enter the Parameter value for <AnyDate>. I want the report to open and from the code to calculate the date for the friday of that week !

instead of anyDate, you insert the field name of the date that you are referencing to find the friday for. . .

in order words, when you look at code, people use the notation, mydatabase, myform, myfield, mytable, my. . . . as a general holding notation, not knowing the names of your actual tables, forms, fields, database, etc. . .

make sense??

sportsguy
 

Users who are viewing this thread

Back
Top Bottom