Another approach is to use the dateserial() function
txtStartDate = DateSerial( _
year([date])-1, _
Month([date]), _
day([date]))
If you wanted to make the startdate the first of the month, you'd
just replace the day([date]) with 1.
Q
"Greg (co*****@gmail.com)" <co*****@gmail.comwrote in
news:c9840edc-610a-4299-ae50-41d8ef0c34f4
@k37g2000hsf.googlegroups.co
m:
Thanks Steve
I just discovered it, and this seems to work:
txtStartDate = DateAdd("m", -12, Date)
Thanks
greg
On Aug 14, 7:10*pm, "Steve" <nonse...@nomsense.comwrote:
>Look at the DateAdd function in the Help file. You would subtract
one yea
r
>from Date().
Steve
<code...@gmail.comwrote in message
news:dedc3798-64a6-4e78-a7f9-99b5ed08d388
@y21g2000hsf.googlegroups
>.com...
>I have a text box with the date "08/14/2008" in it. I want to
press a
button and automatically
calculate and place the date 1-year before in another text box.
Result "08/12/2007".
How do I convert (Date) "08/14/2008" to "08/14/2007" as a
legitimate date, not a text string???
I tried this but I'm getting a string, not a proper date value:
txtStartDate = Month(Date) & " " & Day(Date) & " " & Year(Date)
+ 1
Greg- Hide quoted text -
- Show quoted text -
--
Bob Quintal
PA is y I've altered my email address.
** Posted from
http://www.teranews.com **