Autopopulate a Weekdate from a Recieved date

A

AL Rios

I want to thank the group as you have help me a lot. The issue I have and
still have for many weeks is :

I want to add 7 workdays from the received date.

I have two fields
-A Received date as a Short date field.
-A Due date field as a Short date field

In my Due date field I added the following code in control source
=DateAdd("d",7-Weekday(Date(),2)+2,[received])

I not so concerned about holidays as I have reviewed this group on how to
account for holidays and still am confused on how to get it to work. Not an
expert but I do not know how to create a public function and call that public
function in the Due date filed.

So, I want to take one small step at a time..

Here is an example based on the control source code I entered above.

When I add a date in the received field such as 5 Feb 2010 the due date
field should autopopulate with 15 Feb 2010 vice 13 Feb 2010 (13 Feb 2010 is a
Saturday. I cannot have Saturdays or Sundays as due dates (Lets not worry
about holidays for now) as it tried all the recommendations in this group and
still cannot get it work.

I really need your support on this .

Thank You

Al ( Disable Vet) 30 Years
 
A

Arvin Meyer [MVP]

You can add 7 business days by using the function below:

http://www.datastrat.com/Code/GetBusinessDay.txt

Paste the code into a standard module and call it like:

Call GetBusinessDay(Date(), 7)

If you use it in a query or form, it will display the correct business day
for you (assuming you set up the Holidays table). You do not need a saved
field if you want a date from your table, just use:

Call GetBusinessDay([DateFieldNameFromTable], 7)
 
A

AL Rios

Where do I place the "Call GET Businessdays'" in the control box or in a event?

Thanks for the help...

AL

Arvin Meyer said:
You can add 7 business days by using the function below:

http://www.datastrat.com/Code/GetBusinessDay.txt

Paste the code into a standard module and call it like:

Call GetBusinessDay(Date(), 7)

If you use it in a query or form, it will display the correct business day
for you (assuming you set up the Holidays table). You do not need a saved
field if you want a date from your table, just use:

Call GetBusinessDay([DateFieldNameFromTable], 7)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AL Rios said:
I want to thank the group as you have help me a lot. The issue I have and
still have for many weeks is :

I want to add 7 workdays from the received date.

I have two fields
-A Received date as a Short date field.
-A Due date field as a Short date field

In my Due date field I added the following code in control source
=DateAdd("d",7-Weekday(Date(),2)+2,[received])

I not so concerned about holidays as I have reviewed this group on how to
account for holidays and still am confused on how to get it to work. Not
an
expert but I do not know how to create a public function and call that
public
function in the Due date filed.

So, I want to take one small step at a time..

Here is an example based on the control source code I entered above.

When I add a date in the received field such as 5 Feb 2010 the due date
field should autopopulate with 15 Feb 2010 vice 13 Feb 2010 (13 Feb 2010
is a
Saturday. I cannot have Saturdays or Sundays as due dates (Lets not worry
about holidays for now) as it tried all the recommendations in this group
and
still cannot get it work.

I really need your support on this .

Thank You

Al ( Disable Vet) 30 Years


.
 
A

Arvin Meyer [MVP]

In a query, add a column:

DueDate: GetBusinessDay([DateFieldNameFromTable], 7)

In a form, you'll need to call the function, which you can do in the Current
event, and should also do in the AfterUpdate event of the Received Date
textbox. You do not every need to save the due date, because it can be
easily calculated at runtime.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AL Rios said:
Where do I place the "Call GET Businessdays'" in the control box or in a
event?

Thanks for the help...

AL

Arvin Meyer said:
You can add 7 business days by using the function below:

http://www.datastrat.com/Code/GetBusinessDay.txt

Paste the code into a standard module and call it like:

Call GetBusinessDay(Date(), 7)

If you use it in a query or form, it will display the correct business
day
for you (assuming you set up the Holidays table). You do not need a saved
field if you want a date from your table, just use:

Call GetBusinessDay([DateFieldNameFromTable], 7)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AL Rios said:
I want to thank the group as you have help me a lot. The issue I have
and
still have for many weeks is :

I want to add 7 workdays from the received date.

I have two fields
-A Received date as a Short date field.
-A Due date field as a Short date field

In my Due date field I added the following code in control source
=DateAdd("d",7-Weekday(Date(),2)+2,[received])

I not so concerned about holidays as I have reviewed this group on how
to
account for holidays and still am confused on how to get it to work.
Not
an
expert but I do not know how to create a public function and call that
public
function in the Due date filed.

So, I want to take one small step at a time..

Here is an example based on the control source code I entered above.

When I add a date in the received field such as 5 Feb 2010 the due date
field should autopopulate with 15 Feb 2010 vice 13 Feb 2010 (13 Feb
2010
is a
Saturday. I cannot have Saturdays or Sundays as due dates (Lets not
worry
about holidays for now) as it tried all the recommendations in this
group
and
still cannot get it work.

I really need your support on this .

Thank You

Al ( Disable Vet) 30 Years


.
 
A

AL Rios

I sse no current event on 2007 , so I placed it in afterupdate..no response ..

I assume you wanted me to call it Call GetBusinessDay(Date(),
7)[DateFieldNameFromTable], 7) vice Get Businessday
as I named it in the module per your comments
AL

Arvin Meyer said:
In a query, add a column:

DueDate: GetBusinessDay([DateFieldNameFromTable], 7)

In a form, you'll need to call the function, which you can do in the Current
event, and should also do in the AfterUpdate event of the Received Date
textbox. You do not every need to save the due date, because it can be
easily calculated at runtime.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AL Rios said:
Where do I place the "Call GET Businessdays'" in the control box or in a
event?

Thanks for the help...

AL

Arvin Meyer said:
You can add 7 business days by using the function below:

http://www.datastrat.com/Code/GetBusinessDay.txt

Paste the code into a standard module and call it like:

Call GetBusinessDay(Date(), 7)

If you use it in a query or form, it will display the correct business
day
for you (assuming you set up the Holidays table). You do not need a saved
field if you want a date from your table, just use:

Call GetBusinessDay([DateFieldNameFromTable], 7)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


I want to thank the group as you have help me a lot. The issue I have
and
still have for many weeks is :

I want to add 7 workdays from the received date.

I have two fields
-A Received date as a Short date field.
-A Due date field as a Short date field

In my Due date field I added the following code in control source
=DateAdd("d",7-Weekday(Date(),2)+2,[received])

I not so concerned about holidays as I have reviewed this group on how
to
account for holidays and still am confused on how to get it to work.
Not
an
expert but I do not know how to create a public function and call that
public
function in the Due date filed.

So, I want to take one small step at a time..

Here is an example based on the control source code I entered above.

When I add a date in the received field such as 5 Feb 2010 the due date
field should autopopulate with 15 Feb 2010 vice 13 Feb 2010 (13 Feb
2010
is a
Saturday. I cannot have Saturdays or Sundays as due dates (Lets not
worry
about holidays for now) as it tried all the recommendations in this
group
and
still cannot get it work.

I really need your support on this .

Thank You

Al ( Disable Vet) 30 Years








.


.
 
A

Arvin Meyer [MVP]

DO NOT name the module the same as the function, or the function will fail.
There is a form Current event. Open the form in design view. Open the form's
property sheet. Click on the events tab. The Current event is the very first
event.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

AL Rios said:
I sse no current event on 2007 , so I placed it in afterupdate..no response
..

I assume you wanted me to call it Call GetBusinessDay(Date(),
7)[DateFieldNameFromTable], 7) vice Get Businessday
as I named it in the module per your comments
AL

Arvin Meyer said:
In a query, add a column:

DueDate: GetBusinessDay([DateFieldNameFromTable], 7)

In a form, you'll need to call the function, which you can do in the
Current
event, and should also do in the AfterUpdate event of the Received Date
textbox. You do not every need to save the due date, because it can be
easily calculated at runtime.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AL Rios said:
Where do I place the "Call GET Businessdays'" in the control box or in
a
event?

Thanks for the help...

AL

:

You can add 7 business days by using the function below:

http://www.datastrat.com/Code/GetBusinessDay.txt

Paste the code into a standard module and call it like:

Call GetBusinessDay(Date(), 7)

If you use it in a query or form, it will display the correct business
day
for you (assuming you set up the Holidays table). You do not need a
saved
field if you want a date from your table, just use:

Call GetBusinessDay([DateFieldNameFromTable], 7)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


I want to thank the group as you have help me a lot. The issue I have
and
still have for many weeks is :

I want to add 7 workdays from the received date.

I have two fields
-A Received date as a Short date field.
-A Due date field as a Short date field

In my Due date field I added the following code in control source
=DateAdd("d",7-Weekday(Date(),2)+2,[received])

I not so concerned about holidays as I have reviewed this group on
how
to
account for holidays and still am confused on how to get it to work.
Not
an
expert but I do not know how to create a public function and call
that
public
function in the Due date filed.

So, I want to take one small step at a time..

Here is an example based on the control source code I entered above.

When I add a date in the received field such as 5 Feb 2010 the due
date
field should autopopulate with 15 Feb 2010 vice 13 Feb 2010 (13 Feb
2010
is a
Saturday. I cannot have Saturdays or Sundays as due dates (Lets not
worry
about holidays for now) as it tried all the recommendations in this
group
and
still cannot get it work.

I really need your support on this .

Thank You

Al ( Disable Vet) 30 Years








.


.
 

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