Working days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Matt Dawson said:
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
 
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
 
Matt Dawson said:
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?
 
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 said:
Matt Dawson said:
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)
 
Matt Dawson said:
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?
 
Back
Top