Results 1 to 5 of 5
  1. #1
    brharrii's Avatar
    brharrii is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Jun 2012
    Location
    Seattle, WA
    Posts
    63

    Creating a rotating Job list

    I have two tables. the first is a table of names, the second is a table of jobs that need to be done. I need to develop a job list that assigns a job to each person and then rotates the jobs every month so that everyone gets a new job each month. there are 7 people and 7 jobs. Each person has exactly one job and always has one job.

    I'm inclined to think that a query is the answer here, but I'm not sure how to approach it. If anyone has any suggestions on a good way to go about developing something like this, it would be greatly appreciated.



    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,616
    Have job assignment field in names table. Store the job number in that field. Code to rotate assignments:

    Sub Jobs()
    Dim rs As ADODB.Recordset
    Dim i As Integer
    Set rs = New ADODB.Recordset
    rs.Open "SELECT * FROM Employees ORDER BY JobID DESC;", CurrentProject.Connection, adOpenDynamic, adLockPessimistic
    rs!JobID = 1
    rs.MoveNext
    For i = 7 To 2 Step -1
    rs!JobID = i
    rs.MoveNext
    Next
    rs.Close
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    brharrii's Avatar
    brharrii is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Jun 2012
    Location
    Seattle, WA
    Posts
    63
    Thanks June, you're awesome

    I'll play with this.

  4. #4
    brharrii's Avatar
    brharrii is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Jun 2012
    Location
    Seattle, WA
    Posts
    63
    I'm a bit rough with VBA, I put the code behind a form (is that correct?).

    How do I display the current job assignments?

    Thanks again.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,616
    Goes wherever you want. I tested it from a general module. Can put it in a button Click event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Picture rotating on display Problem
    By justphilip2003 in forum Forms
    Replies: 2
    Last Post: 04-25-2013, 05:44 PM
  2. Replies: 2
    Last Post: 01-25-2013, 04:57 PM
  3. Help: Automated Rotating Schedule
    By Breezer23 in forum Access
    Replies: 2
    Last Post: 01-08-2013, 06:56 PM
  4. Rotating list of names
    By bkvisler in forum Access
    Replies: 15
    Last Post: 07-27-2011, 06:49 PM
  5. Replies: 2
    Last Post: 04-01-2011, 11:30 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