Results 1 to 4 of 4

Thread: Repeat Option?

  1. #1
    Join Date
    Aug 2005

    Unanswered: Repeat Option?

    I have a form, that tracks employee time off.

    Some employees work extra hours and get an extra day off every other week. So they may get every other Friday off.
    Currently we have to manually enter each one of these days into the database.

    What I'm trying to achieve is, make an option where you input the start date. Then have a radio button on the form that says 'repeat every other week'.
    If checked, it will then auto insert an entry a duplicate entry for every other other week. So for example, if I make an entry that for person to have this friday off, if I want to make an entry for the next year for them to have every other Friday after this entry off. I could just check the box, and the form would make an entry for me for every other Friday, so I won't have to manually go in and make a seperate entry for each one.

    I've been looking at the dateadd function, but not sure how to tie it to a option group? I've been searching forums, and the web but just can't see how to tie this all together so it auto inserts these into the table.

    Hope someone has an idea.

    Last edited by cdoyle; 08-24-06 at 10:39.

  2. #2
    Join Date
    Aug 2005
    Anyone know how to accomplish this?

  3. #3
    Join Date
    Aug 2005
    This must be a tough one, no responses

  4. #4
    Join Date
    Dec 2002
    Préverenges, Switzerland
    you are surprised nobody wants to play?

    -throw 26 friDates * N persons (each with a different 1st friDate) into a table
    -automate doing something just after the 26th friDate * N persons
    -undo remaining friDates when you option-off person Y at some arbitrary date
    -handle fractional-friDates if option-off date for person Z is inconvenient
    -reporting when you run out of stored friDates for person X in 45 weeks time

    slipping some code into an option-group _AfterUpdate to get next-friday-but-one into friDate and looping thru friDate = dateadd("d", 14, friDate) 26 times plus a bunch of INSERT INTOs is easy enough.
    but after that?

    maybe you need three mechanisms superimposed:
    -one: handling 'set in concrete' time-off: stuff in the past
    -two: handling 'manually-booked' (and still editable) future time-off
    -three: handling 'auto-repeat' time-off for future dates for all with option-on
    the first two seem relatively easy and can probably even cohabit in the same table with a flag to say when the concrete has set.
    the third feels like it wants to be dynamic, based on the original option-on date and some dateadd() until you get to the end of your reporting period.
    the three feed a temporary table for reporting?

    maybe running the report (or form or startup or whatever) sets in concrete anything in the three mechanisms earlier than Now() ?
    ...plan for a management override to unset concrete when necessary.

    best of luck with it.

    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts