Date field plus 5 work days

G

Guest

I'm not sure if this is possible or not, nor am I sure I'm posting in the
proper group. Please accept appology if this is not the right one.
I would like to put a field on my form that goes out to a table pulls in a
field "due date" and adds 5 days to that. Is this possible? I'm tracking
tooling work loads. The due date is entered by the Engineer and stored in a
table. I would like to make the calculation and see that "new date due" show
up in my form.

Again, sorry if this is confusing or the wrong group to post in.
 
P

PC Datasheet

If you just want 5 calendar days, you can use the DateAdd function:
Me!NewDueDate = DateAdd("d",5,Me!DueDate)

If you want 5 work days, you need to have a holidays table and a way to
exclude Saturday and Sunday if that is
appropriate. You would have to write some VBA code to do this. You would
still use the above expression and then you would check to see if any of the
dates between DueDate and NewDueDate is a Saturday, Sunday or Holiday and
then add another day if it is and then repeat the check again until it is
not.

PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!
 
J

John Newell

Hi Sheila,

Assuming that you have a textbox control on your form named txtDueDate and
the data that gets pulled into that field is actually a date datatype from
your table (let's call it "DueDate" then, try this as the control source for
your txtDueDate field:

=[DueDate] + 5

Hope this helps

Web Guru
"Just a minute, let me Zen on it"
 
G

Graham R Seach

Sheila,

5 working days always equates to 7 calendar days, so the simplistic answer
is:
Me!NewDueDate = Me!DueDate + 7

However, if you need to take into account holidays, run the above code, then
add a day for every date within that range that appears in a Holidays table.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
P

PC Datasheet

In some organizations Saturday is a workday and sometimes Sunday is too. In
these cases 5 working days does not equate to 7 calendar days.
Me!NewDueDate = Me!DueDate + 5 and checking for holidays is the correct
solution. It all depends on what the business rule of the organization is.

PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!
 

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

Top