Excluding weekends and bank holidays

thedeadzeds

Registered User.
Local time
Today, 01:10
Joined
Jan 8, 2014
Messages
40
Hi Guys,

Is there a way of auto populating a date based on another date whilst excluding weekends and bank holidays?

So with regards to the attached database, can date due in frm_1 show 1 WORKING day ahead of the date input (eg date input is 14/10/15 so date due should show 15/10/15). This obviously gets tricky on a Friday (or bank holidays) as I don’t want the date to then show a Saturday for example?

Hope this makes sense?

Regards
 

Attachments

here try a made another table tblHoliday, you should fill this table with actual holidays in your area.
 

Attachments

You are awesome arnelgp
How can i use Two conditions in the same code

I try But I got error (Duplicate declaration in current scope)

Code:
 Select Case B_date
 Case 1
    Const strDateToIgnore As String = "Fri/Sat"
  Case 2
    Const strDateToIgnore As String = "Fri/Sat/mon/wed"
   
   End Select
Thanks
 
then don't use the constant variable


Dim strDateToIgnore as string
Select Case B_date Case 1 strDateToIgnore = "Fri/Sat" Case 2 strDateToIgnore = "Fri/Sat/mon/wed" End Select
 
Hi arnelgp

I fill the tblHoliday with actual holidays in My area, Put the code didn't count it

its value is zero!!
Why??

Thanks a gain
 
from where are you calling this function. its supposed to skip those dates, and in your case statement.
 
from where are you calling this function. its supposed to skip those dates, and in your case statement.

Thanks For your Replay
i put (4) holidays in The table tblHoliday

I call it form the txtInputDate after update

But when enter it doesn't skip those dates
 
is it possible for you to upload your db?
 
The same attach that u r upload

her is it

i fill Holidays but when go to frm_1 the code work normal without skip the Holidays
 

Attachments

Thanks very much
It Works
I have question:
How can i count Friday and Saturday in the month??
 

Users who are viewing this thread

Back
Top Bottom