RE: How to display and store current Week Ending Date (Saturday's)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi

If you have 2 boxes on your form
MyDateBox (where you enter a date)
MySaturdayBox (where you want the next saturday shown - or today if it's Sat
today)

You could have some like this on the AfterUpdate event of your MyDateBox

Private Sub MyDateBox_AfterUpdate()
Me.MySaturdayBox = DateAdd("d", vbSaturday - Weekday(Me.MyDateBox,
vbSunday), Me.MyDateBox)
End Sub

Hope this helps
--
Wayne
Manchester, England.



"ianw" wrote:

I need help in VBA to work out and store week ending dates (Saturday’s) for a
new Time *** application.
I would like Saturday’s week ending date to appear on each days use of the
Time *** form, that would increment each week.
If the time *** form is opened on a Saturday, the week ending date needs
to show as being the same day.
It would also be useful to have the latest week ending date stored as a
singular record in a new table for use in reporting other data using the
latest week ending date.


.


Quantcast