Share via

Control showing week commencing date

Anonymous
2015-04-28T16:39:23+00:00

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

Microsoft 365 and Office | Access | For home | Windows

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.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2015-04-29T08:46:56+00:00

    Hi

    Thanks for the replies.

    I ended up using this in a text box:-

    =[DateField]+1-Weekday([DateField]+6)

    Chris

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2015-04-28T21:56:17+00:00

    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

    Was this answer helpful?

    0 comments No comments
  3. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2015-04-28T19:57:04+00:00

    You should be able to use a text box with a control source like:

    = DateAdd("d",-Weekday([YourDateFieldHere]), [YourDateFieldHere])+2

    Was this answer helpful?

    0 comments No comments