Solved

How make end date 1 year after start date

Posted on 2014-01-18
6
470 Views
Last Modified: 2014-01-18
I have two date fields on a form.  If I enter, for example 7/1/2013 in the start date field I want the end date field to be one year after the start date.

What is the after update code for the start date field?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39790816
=dateadd("yyyy", 1, [StartDate])
0
 

Author Comment

by:SteveL13
ID: 39790818
Will that also account for leap year?
0
 

Author Comment

by:SteveL13
ID: 39790824
And I had to add

-1

to the end.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39790825
what exactly do you mean?

this

dateadd("yyyy",1,date())
1/18/2015


dateadd("yyyy",1,date()-1)
1/17/2015
0
 

Author Comment

by:SteveL13
ID: 39790834
What I mean is if I start with 7/1/2013 and want to end with 6/30/2014 I have to have:

    Me.txtEndDate = DateAdd("yyyy", 1, [txtStartDate]) - 1

It works!
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39790839
that is correct...
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question