Results 1 to 7 of 7
  1. #1
    Mike Griffin is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Posts
    3

    how to create a table that will take one scheduled date and populate following scheduled date record

    I have a Material Tracking Database. We have 45 large components that require a week or so to load each one. I was looking for a simple way to populate a given record with a start date and have the following components (records) be populated with start dates aligning with the 7 day loading time. I was also hoping to be able to generate a report that would show all projected dates. I anticipate the crews will improve production time so I would like to be able to change the loading time duration and project those dates as well. I think I've made this harder than it should be.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I envision a table with the 45 components, a sort order and loading time. You can loop that and populate component records using the loading time from there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Mike Griffin is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Posts
    3
    Sorry but I'm kind of a beginner. I don't understand phrase loop?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You'd open a recordset on that table in VBA and loop the resulting records. Here's my template code for that:

    Code:
      Dim strSQL  As String
      Dim db      As DAO.Database
      Dim rs      As DAO.Recordset
    
    
      Set db = CurrentDb()
      
      strSQL = "SELECT ..."
      Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
    
    
      Do While Not rs.EOF
    
    
        rs.MoveNext
      Loop
    
    
      rs.Close
      set rs = nothing
      set db = nothing
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    In your case looping means automatically examining/updating table records one at a time, starting at the beginning.
    The first record gets a given date, the next 7 days later, the next 7 days after that and so on.
    Is that the intent of your posting?
    You would use a form to enter the first date, and a text box to enter the number of days to increment each record.

  6. #6
    Mike Griffin is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Posts
    3
    Thank you. Ive been away from my desk today so I just got this. I'll give it a try. thanks again for getting back to me.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 02-08-2018, 08:19 AM
  2. add scheduled to outlook calendar
    By vicsaccess in forum Import/Export Data
    Replies: 2
    Last Post: 12-28-2015, 01:19 PM
  3. Replies: 4
    Last Post: 02-24-2014, 09:20 AM
  4. Windows XP Scheduled Task
    By markgroupMI in forum Programming
    Replies: 1
    Last Post: 11-01-2013, 07:48 AM
  5. Display value in a text box after scheduled date
    By venu_resoju in forum Forms
    Replies: 5
    Last Post: 01-06-2013, 01:13 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