Results 1 to 3 of 3
  1. #1
    ExtremeNovice is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    24

    Variable Default Values for a Date


    I have a field on a form that I want to default to the next upcoming pay date. Pay dates are on the 5th and the 20th. So for example, if data is being entered into the form on the 1st, the pay date will be the 5th. If data is being entered on the 6th, the pay date will be the 20th. If data is being entered on the 21st the pay date will be on the 5th of the next month. And, (although this will only be once a year) if data is being entered on the 29th of December (for example) the pay date will be on the 5th of the next month, and the next year.
    I have been tinkering around with a formula to input into the default value but I haven't had much luck - any ideas on how to build this formula (and, if not the default value, where it should be input)?
    Thanks

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You could create a table of pay dates, then use DLookup
    =DLookUp("Min(PayDate)","tblPayDates","PayDate>Dat e()")

  3. #3
    ExtremeNovice is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    24
    That works quite well - Thanks!

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

Similar Threads

  1. Replies: 1
    Last Post: 01-04-2014, 09:44 PM
  2. Setting Variable Default for Combo Box
    By gazaway in forum Forms
    Replies: 5
    Last Post: 04-08-2013, 10:32 AM
  3. Replies: 10
    Last Post: 11-06-2011, 01:30 PM
  4. Default Min & Max Date Values in Form
    By alsoto in forum Forms
    Replies: 3
    Last Post: 10-03-2011, 10:54 AM
  5. Replies: 2
    Last Post: 08-05-2011, 04:41 PM

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