data validation on form involving date control

T

Ted

i have a date control on my form i coined 'On-Study Date'. can i guarantee
that the input date the user enters is at most NOT 10 years before the
current one: Date().

as fate would have it, my a2k 'Help' documentation has inscrutably chosen
this day to be the one when it won't answer the helm, i.e. is literally NO
help :-(
 
T

Ted

i think it works, karl. would it be possible to use the "DateAdd" function
(about which i see no help owing to the dubious behavior of my a2k's at the
present moment). i think you can structure it so that you 'add' some unit of
time days, weeks, mnths, years.
 
K

KARL DEWEY

I tried DateAdd("y",-10, xxxx but it did not test correcty. It test as if
DateAdd("d",-10, xxxx
 
D

Douglas J. Steele

It's "yyyy" for years, not "y". "y" stands for "day of year" which, as
you've discovered, is the same as "d".
 
T

Ted

subtle are the ways of this are they not?

BIG thanks to you (both).

tomorrow i will probably have to call microsoft tech support and try to
decypher what's keeping the help documentation from me.

with best regards,

-ted
 
T

Ted

hi doug:

you know i didn't actually attempt the repair until after i sent my reaction
to the posting.

i just tried
DateAdd("yyyy",-10,[On-Study Date]) And <=Date()

in the validation field of "On-Study Date" and it does NOT work.

karl dewey's did continue to, though.
 
T

Ted

never mind guys, i figured it out :)

Douglas J. Steele said:
It's "yyyy" for years, not "y". "y" stands for "day of year" which, as
you've discovered, is the same as "d".
 
Top