Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How make end date 1 year after start date

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?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SteveL13

ASKER

Will that also account for leap year?
And I had to add

-1

to the end.
what exactly do you mean?

this

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


dateadd("yyyy",1,date()-1)
1/17/2015
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!
that is correct...