No, what I meant was, if I put the -1 within the Year() parenthesis, I got a
#Error in the text box field (when used in the default value field). When I
moved the -1 out of the Year function, it worked.
You're correct of course, much better to use Date() than Now(). Date Serial
seems like a easier function to deal with.
"Arno R" <ar****************@planet.nlwrote in message
news:46***********************@text.nova.planet.nl ...
"ARC" <an**@andyc.comschreef in bericht
news:jH*******************@newssvr12.news.prodigy. net...
You're welcome. I've never used CDate, and my only source was the access
97
help file, and looking through all the date functions.
I did play with the syntax a bit, and it took a number of tries to get it,
I
tried Year(Now() -1), but that errored out.. So you have to take off the 1
after the Year() function, not within it. Definetely trial and error..
After
the inner parens, Access will just see: CVDate("31/12/2006")
Year(Now() -1) or Year (Now -1) will give you 2007, so it did not result in
the right output.
Is this what you mean with 'errored out' ??
Also: Now() gives you the date AND the time.
Better use Date() if you only want to use the date.
Another option for OP's question is the DateSerial() function.
DateSerial(Year(Date) -1, 12, 31)
Arno R