A family of Microsoft relational database management systems designed for ease of use.
Hi
Thanks for the replies.
I ended up using this in a text box:-
=[DateField]+1-Weekday([DateField]+6)
Chris
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I have a report which is grouped on a date field by week so all the dates within the week are grouped together.
Is it possible for the title of the group to contain a control that can work out the week commencing date?
So the header for each group on the report will say Week Commencing Monday [Monday's Date].
Thanks
Chris
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi
Thanks for the replies.
I ended up using this in a text box:-
=[DateField]+1-Weekday([DateField]+6)
Chris
I use the following function:
Public Function WeekStart(intStartDay As Integer, Optional varDate As Variant)
' Returns 'week starting' date for any date
' Arguments:
' 1. intStartDay - weekday on which week starts, 1-7 (Sun - Sat)
' 2. vardate - optional date value for which week starting
' date to be returned. Defaults to current date
If IsMissing(varDate) Then varDate = VBA.Date
If Not IsNull(varDate) Then
WeekStart = DateValue(varDate) - Weekday(varDate, intStartDay) + 1
End If
End Function
You should be able to use a text box with a control source like:
= DateAdd("d",-Weekday([YourDateFieldHere]), [YourDateFieldHere])+2