Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15

    Pushing dates in production schedule

    I have a database which I use for scheduling production. I would like to know if there is a way to "push" the schedule dates. I have multiple products scheduled for production but at times I need to adjust the production dates by pushing all the schedule dates ahead by one day. I don't want to re-enter all the dates to do this adjustments.
    Any help woukld be appreciated.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I don't know your system structure but you can certainly adjust a date by one day with ease.

  3. #3
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15
    I do my scheduling in a form called "Production Schedule" with a record source from a query called "Scheduling Query". The field names are job, structure#, structure type, schedule date, priorty.
    The problem is the daily production schedule is filled out for two weeks and if we lose a day of production for some reason, snow storm, I need to move everything forward a day and skip the weekends or I may want to insert a job into the middle of the schedule.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I've got to leave for a few hours but will check in when I get back. You could create a function that would update the field and skipping weekends is easy. How would you identify all of the records that need the schedule date bumped? I'll be back.

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    The high level aspect of your database do us nodda. What rural guy suggested is what you should do. How would you flag them is probally really simple. Every productionline usually has a way of referencing every part made.
    If you had a column on your rows named recordflag. and the date field was in question. you could run this query and it would ask you for the date, where ever the flag had been set.
    update tblProductionLine set mydatefield=[dateyouwant] where recordflagfield=true

  6. #6
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15
    I would have a query with only the records that need to be moved. Sorry if this unclear, I'm new at this.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by OCStan View Post
    I would have a query with only the records that need to be moved. Sorry if this unclear, I'm new at this.
    Can you create a query that returns all of the records that need bumping? If so then turning it into an update query would be easy.

  8. #8
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15
    Yes I can create the query for only the records to bump. Not sure how to do an update query.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Next we need to create a Function in a Standard module that can adjust a date skipping weekends. I'll get to work on it in a bit.

  10. #10
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15
    Thanks. I created an update query with "DateAdd("w",1,[scheduled])" in "update to" and it adds a day but it won't skip weekends.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That's why we need a user defined Function. The Weekday(NewDate) needs to be < 6, 6 being Saturday.

  12. #12
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,737
    Quote Originally Posted by OCStan View Post
    Thanks. I created an update query with "DateAdd("w",1,[scheduled])" in "update to" and it adds a day but it won't skip weekends.
    I don't think your explanation is correct. I think this would add a 1 week.

    Please follow RuralGuy's lead - he'll get you the answer.

  13. #13
    OCStan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    15
    I switched it from "w" to "d".

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    There is no built in function to skip weekends. We just have to build one.

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try this Function in a Standard Module named basFunctions:
    Code:
    Function BumpDate(InDate As Date, BumpBy As Integer) As Date
    ' Adjust the InDate by the BumpBy value, skipping weekends
    'If you want to bump by one then use:
    'NewDate = BumpDate(OldDate, 1)
       Dim Looping As Boolean
       Looping = True
       BumpDate = InDate
       Do While Looping
          BumpDate = BumpDate + BumpBy
          Looping = Weekday(BumpDate, vbMonday) > 5
       Loop
    End Function

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. production records
    By adriana in forum SQL Server
    Replies: 3
    Last Post: 05-11-2013, 11:16 AM
  2. Pushing Data From one form to another
    By zipmaster07 in forum Forms
    Replies: 21
    Last Post: 02-03-2012, 10:30 AM
  3. Replies: 0
    Last Post: 12-07-2011, 09:37 AM
  4. Production Tracking
    By old_chopper in forum Access
    Replies: 2
    Last Post: 10-11-2010, 12:12 PM
  5. Production
    By teranet in forum Access
    Replies: 1
    Last Post: 06-07-2008, 06:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums