Auto generate date for new date field

graemespence1

New member
Local time
Today, 19:18
Joined
Aug 15, 2012
Messages
3
Hello I am new to the forum and in need of advice.
I have a database that records weekly the number of people who use the halls in the community centre. I have all the fields created but I have a date field called week commencing and when i create a new record i need to manually select the date in my case the Monday of a new week.
My question is that is there anyway I can have the week commencing field auto matically select the monday everytime i create a new week and is it difficult to do as I do not have more than a basic knowledge of SQL coding.
I thank the community for any help in this matter
 
Try

weekstart: yourdate-weekday(yourdate,vbmonday) + 1 in the date field.
 
it's not working i tried entering it into the input mask field, default value field or the validation rule field in the design view could you please tell me where to enter the code.
 
Not sure mate. Found that floating the net.

I am sure vba will come in and help.
 
Hi.. I am not sure if this is what you are after..
Code:
DateAdd("d",9-Weekday(Date),Date)
NOTE: This will however not be accurate if the date falls on a Sunday/Monday.. The following will is the TestCase Result..
08/08/2012 : 13/08/2012
09/08/2012 : 13/08/2012
10/08/2012 : 13/08/2012
11/08/2012 : 13/08/2012
12/08/2012 : 20/08/2012 '12/08/2012 Falls on Sunday, so instead of showing 13/08/2012 it shows the next week.
13/08/2012 : 20/08/2012 'Same as the above
14/08/2012 : 20/08/2012
15/08/2012 : 20/08/2012

I would suggest you wait and see if there are other better answers..
 

Users who are viewing this thread

Back
Top Bottom