Create a calculated date in a field on input form

S

Steve in S.F.

I need to create an input form in which there is a field for the user to
input a year. After the user enters a year I would like a date to appear in
another field. The date would always be the same month and day (June 1) and
the year would be six years before the date entered in the Year field.

So for example if the user enters "2010" in the Year field, the calculated
Date Field would show: 06/01/2004.

Is there some formula (I guess using some date function) that I can use in
the Control Source property of the Date Field that would yield the date that
I need? Or any other method to get this result?

Thanks,

Steve
 
M

Marshall Barton

Steve said:
I need to create an input form in which there is a field for the user to
input a year. After the user enters a year I would like a date to appear in
another field. The date would always be the same month and day (June 1) and
the year would be six years before the date entered in the Year field.

So for example if the user enters "2010" in the Year field, the calculated
Date Field would show: 06/01/2004.

Is there some formula (I guess using some date function) that I can use in
the Control Source property of the Date Field that would yield the date that
I need? Or any other method to get this result?


=DateSerial(YearField - 6, 6, 1)
 
S

Steve in S.F.

Thanks so much - I don't even find that function in help for either Access or
Excel, but it definitely works!
 
M

Mike Painter

Open a module and click on help. It will give you VBA information that
contains things like this.
 
S

Steve in S.F.

I should have thought of that -- Thanks!

Mike Painter said:
Open a module and click on help. It will give you VBA information that
contains things like this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top