Results 1 to 6 of 6
  1. #1
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14

    Adding a different due date for different combo box selections


    I'm working on a database where users enter an assignment into a datasheet form. Assignments are selected from a combo box that has values stored in a table. After choosing the assignment, the user adds the date it was completed. After this is done, I would like the "Next Due" column to update. Each assignment will have a different next due date, such as one year from the completion date, six months, etc. I don't know how to add different values depending on the combo box selection.
    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	2.6 KB 
ID:	20298
    Any help would be appreciated.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    What are the rules for determining interval?

    Options for calculating the NextDue date:

    1. hard code those rules in VBA procedure

    2. build a table of the intervals for each assignment then join that table to the data input table.
    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
    JLCan is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2015
    Location
    Montréal
    Posts
    11
    Hi Pdow!

    In the assignment table add an interval field - this will specify the interval for every assignment.

    To the combo, add a new column with 0 length holding the integer interval (in days).
    In the AfterUpdate event of the combo, after proper check, store the value DateAdd("d", interval, DateCompleted) in the Next Due text box.

    Voilà!!!

    Good luck, JLCan.

  4. #4
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14
    Thanks for the help. One follow up question:

    Is it generally a better idea to add months instead of days to avoid leap year issues?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Why would leap year an issue except for birth dates?
    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.

  6. #6
    JLCan is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2015
    Location
    Montréal
    Posts
    11
    Hi Pdowg881!

    It doesn't really matter as long as you are consistent. Months would definitely avoid leap year bias.

    Good luck, JLCantara.

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

Similar Threads

  1. Multiple Selections in a Combo Box
    By BeStout in forum Access
    Replies: 6
    Last Post: 07-09-2014, 12:44 PM
  2. Replies: 5
    Last Post: 01-15-2013, 01:27 PM
  3. Combo Boxes, Selections, frustrations
    By redbull in forum Programming
    Replies: 14
    Last Post: 10-23-2012, 11:41 AM
  4. Replies: 3
    Last Post: 04-09-2012, 10:16 AM
  5. Adding selections to some sort of table
    By shabbaranks in forum Access
    Replies: 15
    Last Post: 10-18-2011, 07:45 PM

Tags for this Thread

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