K
klp via AccessMonster.com
I have a customer orders form where there is a due date. Currently we can
either select the date from the calendar OR put in your own date. The default
for the due date field is set to = Date() + 1. For next day shipping.
However, I want to be able to skip the weekends and only acknowledge the week
days. So I created a function as follows:
Function WorkDays(dtCurrDate As Date, dtNewDate As Date) As Integer
If Weekday(dtCurrDate, vbUseSystemDayOfWeek) = 1 Then
'if Sunday
dtNewDate = dtCurrDate + 1
ElseIf Weekday(dtCurrDate, vbUseSystemDayOfWeek) = 7 Then
'if Saturday
dtNewDate = dtCurrDate + 2
End If
End Function
Not having used the modules that much, I'm not sure where you place the logic
in the customer orders form, and how to call it. I have an idea but am
stumped somewhat. Would I place my logic on my due date field or on the form
myself?
Thanks in advance.
either select the date from the calendar OR put in your own date. The default
for the due date field is set to = Date() + 1. For next day shipping.
However, I want to be able to skip the weekends and only acknowledge the week
days. So I created a function as follows:
Function WorkDays(dtCurrDate As Date, dtNewDate As Date) As Integer
If Weekday(dtCurrDate, vbUseSystemDayOfWeek) = 1 Then
'if Sunday
dtNewDate = dtCurrDate + 1
ElseIf Weekday(dtCurrDate, vbUseSystemDayOfWeek) = 7 Then
'if Saturday
dtNewDate = dtCurrDate + 2
End If
End Function
Not having used the modules that much, I'm not sure where you place the logic
in the customer orders form, and how to call it. I have an idea but am
stumped somewhat. Would I place my logic on my due date field or on the form
myself?
Thanks in advance.