Year - 1

  • Thread starter Dimitris Nikolakakis
  • Start date
D

Dimitris Nikolakakis

In a form I have two Text Boxes. In the first the user gives a date. How can
I automatically calculate the the 2nd Text Box to have the date of 1st minus
one year?

eg 1stDATE = 01/01/2005 ------> 2ndDATE = 01/01/2004

thanks in advance
Dimitris
 
R

Rick Brandt

Dimitris said:
In a form I have two Text Boxes. In the first the user gives a date.
How can I automatically calculate the the 2nd Text Box to have the
date of 1st minus one year?

eg 1stDATE = 01/01/2005 ------> 2ndDATE = 01/01/2004

thanks in advance
Dimitris

=DateAdd("yyyy", -1, 1stDATE)
 
J

John Vinson

In a form I have two Text Boxes. In the first the user gives a date. How can
I automatically calculate the the 2nd Text Box to have the date of 1st minus
one year?

eg 1stDATE = 01/01/2005 ------> 2ndDATE = 01/01/2004

Set the second textbox's Control Source to

=DateAdd("yyyy", -1, [1stDate])

Note that 2ndDate should NOT be stored in any table - it should be an
unbound textbox, recalculated as needed.


John W. Vinson[MVP]
 
Top