I live in UK, and where I work, the week starts on a Saturday, I have a form based on a table with several fields, four of which are "Date" "Week" "Month" and "Year"
When the user enters the date, the other three fields are filled automatically from the date using the following code, my problem is that if the date entered is the Saturday, the week number that is extracted is the previous week as Saturday starts our new week, and the system thinks Sunday is first day. I am sure that some of you will have an easy answer that I have missed, but I need help please. All four fields are needed for various different reporting functions. I need the automatic option to reduce the risk of error in Month etc. I searched for Firstdayofweek etc but can find nothing.
Private Sub Date_AfterUpdate()
Me![Year] = DatePart("yyyy", [date])
Me![week] = DatePart("ww", [date])
Me![Month] = Format([date], "mmmm")
End Sub
TIA
Dave
When the user enters the date, the other three fields are filled automatically from the date using the following code, my problem is that if the date entered is the Saturday, the week number that is extracted is the previous week as Saturday starts our new week, and the system thinks Sunday is first day. I am sure that some of you will have an easy answer that I have missed, but I need help please. All four fields are needed for various different reporting functions. I need the automatic option to reduce the risk of error in Month etc. I searched for Firstdayofweek etc but can find nothing.
Private Sub Date_AfterUpdate()
Me![Year] = DatePart("yyyy", [date])
Me![week] = DatePart("ww", [date])
Me![Month] = Format([date], "mmmm")
End Sub
TIA
Dave