Working Days but different condition

vspsdca

New member
Local time
Today, 11:35
Joined
May 7, 2008
Messages
8
Hi,
I'm pretty new here. A newbie on VBA as well. I just need some help on a form i'm working on. My scenario:

Date Request Raised
SLA for Days = with values of 1,5,7,10,20,30 (this is in a combo box)
Deadline for entry

What i would like to happen is for the Deadline For Entry box be automatically filled after the SLA for Days has been chosen but shouldn't count the weekends...(perhaps a code on the AfterUpdate????)

For Example:

Date Request Raised: 06/11/2008
SLA = 5

The Deadline for Entry should automatically be set to 13/11/2008

I know there has been a lot of topics that has been posted here regarding Working Days between two dates but I couldn't find anything on a start date plus no. of days to return a due date. Though i have found one topic, unfortunately no one responded to the post. :o

Any help will be very much appreciated.

Many thanks.
 
Find the Workingdate function on the forum (you did this allready appearently)

Create a table with numbers 1 thru 30, or however many days you need. Mind you DAYS not working days.
Now create a query that will fetch the RequestDate and add to that your days from this table.
i.e.
Code:
Select [RequestDate] + [ThisNumber] 
from yourNumberTable
where isworkdayFunction([RequestDate] + [ThisNumber] ) = true

This will fetch all workdays for a given future, i.e. 30 days into the future.
You then open this query in code and jump to the Workday you need,
i.e. move 3
To move to the 3rd record, this is the date you want/need.

Alternatively you can loop the days yourself in code, but I am a strong believer of using SQL where possible.

I hope you can make heads or tails from this... if not feel free to ask...

Edit:
Welcome to (one of ;) ) the best access forums on the Internet.
 

Users who are viewing this thread

Back
Top Bottom