Results 1 to 4 of 4
  1. #1
    JNeville is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2017
    Posts
    2

    Date boxes

    Hi All



    I need some assistance I have two date boxes in my form. The first date box is used by the person entering the date. I'd like the 'Calibration Due Date' to be added automatically but with 1 year added on.

    How can I do this?

    Click image for larger version. 

Name:	date.JPG 
Views:	10 
Size:	19.1 KB 
ID:	29963

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    txtCalDue.controlSource = DateAdd("yyyy",1,txtDate)

  3. #3
    JNeville is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2017
    Posts
    2
    Quote Originally Posted by ranman256 View Post
    txtCalDue.controlSource = DateAdd("yyyy",1,txtDate)
    Thanks ranman. Its been years since i have used Access where do i need to enter this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Saving calculated data (data dependent on other data) to table is not always necessary and can even be very bad design.

    If the next calibration due date is always +1 year, in textbox ControlSource property: =DateAdd("yyyy",1,CalDate).

    If you really must save calculated value, then code could go in the AfterUpdate event of the user input textbox:

    Me.CalDueDate = DateAdd("yyyy", 1, Me.CalDate)

    If you don't want to allow user to change this value then set CalDueDate textbox as Locked Yes, TabStop No.


    Date is a reserved word, should not use reserved words as names for anything. Advise no spaces or punctuation/special characters (underscore only exception) in names.
    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. Text boxes = Date + 1 (Sunday to Saturday)
    By djspod in forum Access
    Replies: 12
    Last Post: 01-05-2017, 05:30 PM
  2. Replies: 3
    Last Post: 01-21-2015, 02:40 PM
  3. Filtering data with date and check boxes
    By raffyT in forum Access
    Replies: 9
    Last Post: 08-26-2014, 11:46 AM
  4. Determining the value of 3 Date/Time Boxes....Newbie
    By REAbernathy in forum Programming
    Replies: 3
    Last Post: 09-12-2012, 12:05 PM
  5. date range text boxes
    By 4shl3y in forum Forms
    Replies: 5
    Last Post: 07-27-2012, 08: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