Due Date Based on Purchase Date

vcarrill

Registered User.
Local time
Yesterday, 19:25
Joined
Aug 22, 2019
Messages
60
Hello Geniuses!

I have a "Purchase Date" field and a "Due Date" field.

I need the "Due Date" field to auto populate +7 working days excluding the weekend.

How would I accomplish this?

Thank you
 
Hi. One way is to use the fAddWorkdays() custom function. For example:
Code:
Me.DueDate=fAddWorkdays(7,Me.PurchaseDate)
(I could be wrong with the syntax.)
 
Very important questions; will you need to deal with holidays?; When does the "Next day" start?; How often will data be entered that should actually be considered as "On the next day?"; Can the due date be changed after it is created?

Working with due dates can become very messy if you don't find all the conditions that can affect it. This is very important when you start seeing data put in after "business hours" that is expected to be dealt with one day later than your program expects or "needs to be adjusted" based on other criteria.
 
For example, in the AfterUpdate event of Purchase Date.
 
Hello,

The due date is an "estimate" only.

Example: Purchase Date Monday 11/4/19
Due Date would be 11/13/19, not including weekends on a basic Mon - Fri work week.

Holidays may offset this date, but since it is an estimate I think it would be acceptable. I am looking for a general date to be expecting the delivery of the item.
 
I entered the code

Me.DueDate=fAddWorkdays(7,Me.PurchaseDate)

In the AfterUpdate event of Purchase Date and its not working?
 
Any suggestions/help?

Thank you very much everyone!
 
I entered the code

Me.DueDate=fAddWorkdays(7,Me.PurchaseDate)

In the AfterUpdate event of Purchase Date and its not working?
First, did you download the file from the link I posted?
 
Yes I have it, please forgive my ignorance but I was not sure where to copy/paste the content. Would it be under Module?
 
Yes I have it, please forgive my ignorance but I was not sure where to copy/paste the content. Would it be under Module?
Yes, and make sure you leave the name as Module1 (or something similar). Also, please double check the syntax. I wasn't sure if the number comes first or later. Let us know how it goes.
 
Ok, I did as instructed and copied the material under Module 1.

I entered:

Me.DueDate=fAddWorkdays(7,Me.PurchaseDate) in the AfterUpdate event of Purchase Date.

When I entered 11/4/19 under Purchase Date, the Due Date says 10/20/2067.
 
Ok, I did as instructed and copied the material under Module 1.

I entered:

Me.DueDate=fAddWorkdays(7,Me.PurchaseDate) in the AfterUpdate event of Purchase Date.

When I entered 11/4/19 under Purchase Date, the Due Date says 10/20/2067.
Hi. Did you verify the syntax like I said? I don't have a copy of the file to verify for you. Can you maybe post the function declaration?
 
Okay. I downloaded the file to check the required syntax. I had it backwards. Try it this way.
Code:
Me.DueDate=fAddWorkdays(Me.PurchaseDate,7)
 
Is the function declaration the content in Module 1?
 

Users who are viewing this thread

Back
Top Bottom