Using Previous Record in a formula

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

Guest
I want to be able to take the date of production from the previous record and add 1 day to it.

I have a production schedule that states employee A is working 8 hours and making X products for Jan.29-Feb.15 (Or whatever dates he is booked for). The problem happens when he falls behind estimated production. I need to be able to update the days scheduled by however many days he is behind. Easy - except that I need to skip weekends and holidays. What I have been trying is the datepart()function to bring back the weekday, if 7 add additional 2 days, if 1 add addition 1 day. Unfortunatly this causes the person to be scheduled for more than 8 hours work for one day, and causes some days to be missed.

So I think that if I can just add 1 to the previous record (unless Sat. or Sun.) I would be OK. Any suggestions will help. I am relatively new to code.

KAren
 
Hi Karen,

don't give up! You can do this workday-function - but first you need to set up a full calender stating Sat/Sun and all the required holidays.
Then you do a DMin("DateField","TableCalender","[DateField]>[StartDate])

(and set this to defaultValue for the control)

Mic
 
How would I get my start date to change each time. I had thought about the min or max feature, but I still am not sure how. So if Employee A is 3 days behind starting Feb.2. Then for this code I need my initial start date to be Feb.4, then I need Feb.5 etc. So would I use a text box or how would I get the startdate?
 

Users who are viewing this thread

Back
Top Bottom