Fromdate Todate

MyOwnBoss

Registered User.
Local time
Today, 05:53
Joined
Apr 30, 2009
Messages
12
Hi All,

I need to determine the strart and end of a given week from the date in a textbox.

Example the date is 5/8/2009 then calculate the beginning of the week (vbSunday) +7 to give a result start=5/3/2009 and end=5/9/2009

I am doing this so the user can select any record created during the week for a client and be able to generate a weekly report with out addition input (Sunday thru Saturday).

All help appreciated!
 
Howzit

You can have two more text boxes on your form to hold these two dates and in the after update event procedure of your text box,you can have something like

BOW:
Code:
me.BOWControl =  DateAdd("d",1-Weekday([Forms]![yourform]![yourcontrol]),[Forms]![yourform]![yourcontrol])
' Take the weekday value from the selected date and then add 1

EOW

Code:
me.EOWControl =  DateAdd("d",6,me.BOWControl) ' add 6 days to BOW control date
 
Excellent!

Thanks so much.
 

Users who are viewing this thread

Back
Top Bottom