Calculate Monday date based on date typed in

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Our work week is Monday to Sunday. Based on the date typed in we want to
return the Monday date of the work week:

Ex. type in 11/12/06 and return the date 11/06/06 -(NOT 11/13/06).

Is this possible?
 
Patricia said:
Our work week is Monday to Sunday. Based on the date typed in we want to
return the Monday date of the work week:

Ex. type in 11/12/06 and return the date 11/06/06 -(NOT 11/13/06).

Is this possible?

DateAdd("d", -WeekDay([DateValue],vbMonday) + 1, [DateValue])
 
Private Sub MyDate_AfterUpdate()
If IsDate(Me.MyDate) Then
Me.MyDate = Me.MyDate - Weekday(Me.MyDate, vbMonday) + 1
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top