A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Working days



 
 
Thread Tools Display Modes
  #1  
Old September 5th, 2006, 09:39 AM posted to microsoft.public.access.forms
Matt Dawson
external usenet poster
 
Posts: 169
Default Working days

I have a field that updates upon the checking of a tick box. A further field
is linked to the updated one which is basically 3 days after the updated box.
Is it possible to make this update 3 working days after, rather than a simple
Date()+3.
Many Thanks,
Matt
  #2  
Old September 5th, 2006, 09:57 AM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 1,164
Default Working days

"Matt Dawson" wrote in message

I have a field that updates upon the checking of a tick box. A
further field is linked to the updated one which is basically 3 days
after the updated box. Is it possible to make this update 3 working
days after, rather than a simple Date()+3.


The functions posted here should be able to help you:

http://www.mvps.org/access/datetime/date0012.htm
Date/Time: Doing WorkDay Math in VBA

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #3  
Old September 5th, 2006, 10:38 AM posted to microsoft.public.access.forms
Matt Dawson
external usenet poster
 
Posts: 169
Default Working days

Ok, at present I cant seem to be able to make this work.
Should the code read:

Private Sub Quote_Sent_AfterUpdate()
If Me![Quote Sent] = -1 Then
Me![Contract Quote Date] = Date
Me![Chase Up Date] = dhAddWorkDaysA(3, [Contract Quote Date])

The chase up date is based on the figure in contract quote date but should
be 3 working days after. Contract quote date is based on whenever the Quote
Sent box was checked.

Thanks,
Matt

"Dirk Goldgar" wrote:

"Matt Dawson" wrote in message

I have a field that updates upon the checking of a tick box. A
further field is linked to the updated one which is basically 3 days
after the updated box. Is it possible to make this update 3 working
days after, rather than a simple Date()+3.


The functions posted here should be able to help you:

http://www.mvps.org/access/datetime/date0012.htm
Date/Time: Doing WorkDay Math in VBA

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



  #4  
Old September 5th, 2006, 10:45 AM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 1,164
Default Working days

"Matt Dawson" wrote in message

Ok, at present I cant seem to be able to make this work.
Should the code read:

Private Sub Quote_Sent_AfterUpdate()
If Me![Quote Sent] = -1 Then
Me![Contract Quote Date] = Date
Me![Chase Up Date] = dhAddWorkDaysA(3, [Contract Quote Date])

The chase up date is based on the figure in contract quote date but
should be 3 working days after. Contract quote date is based on
whenever the Quote Sent box was checked.


That looks like it should work. What's actually happening when you
update [Quote Sent]? In what way is it not working? Are you getting an
error message?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #5  
Old September 5th, 2006, 11:12 AM posted to microsoft.public.access.forms
Matt Dawson
external usenet poster
 
Posts: 169
Default Working days

I get an error message saying 'Sub or function not defined'. The line Private
Sub Quote_Sent_AfterUpdate() is highlighted yellow, with dhAddWorkDaysA
highlited as if selected.
Matt

"Dirk Goldgar" wrote:

"Matt Dawson" wrote in message

Ok, at present I cant seem to be able to make this work.
Should the code read:

Private Sub Quote_Sent_AfterUpdate()
If Me![Quote Sent] = -1 Then
Me![Contract Quote Date] = Date
Me![Chase Up Date] = dhAddWorkDaysA(3, [Contract Quote Date])

The chase up date is based on the figure in contract quote date but
should be 3 working days after. Contract quote date is based on
whenever the Quote Sent box was checked.


That looks like it should work. What's actually happening when you
update [Quote Sent]? In what way is it not working? Are you getting an
error message?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



  #6  
Old September 5th, 2006, 05:30 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 1,164
Default Working days

"Matt Dawson" wrote in message

I get an error message saying 'Sub or function not defined'. The line
Private Sub Quote_Sent_AfterUpdate() is highlighted yellow, with
dhAddWorkDaysA highlited as if selected.


Did you copy all the code from that page, everything between "*** Code
Start ***" and "*** Code End ***", and paste it into a new standard
module?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #7  
Old September 6th, 2006, 11:19 AM posted to microsoft.public.access.forms
Matt Dawson
external usenet poster
 
Posts: 169
Default Working days

Dirk,
You are a hero, it all works now, was my own stupid fault!
Many Thanks,
Matt

"Dirk Goldgar" wrote:

"Matt Dawson" wrote in message

I get an error message saying 'Sub or function not defined'. The line
Private Sub Quote_Sent_AfterUpdate() is highlighted yellow, with
dhAddWorkDaysA highlited as if selected.


Did you copy all the code from that page, everything between "*** Code
Start ***" and "*** Code End ***", and paste it into a new standard
module?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.