PC Review


Reply
Thread Tools Rate Thread

Create a calculated date in a field on input form

 
 
Steve in S.F.
Guest
Posts: n/a
 
      24th Oct 2008
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
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      24th Oct 2008
Steve in S.F. wrote:

>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)

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
 
Steve in S.F.
Guest
Posts: n/a
 
      25th Oct 2008
Thanks so much - I don't even find that function in help for either Access or
Excel, but it definitely works!

"Marshall Barton" wrote:

> Steve in S.F. wrote:
>
> >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)
>
> --
> Marsh
> MVP [MS Access]
>

 
Reply With Quote
 
Mike Painter
Guest
Posts: n/a
 
      25th Oct 2008

Open a module and click on help. It will give you VBA information that
contains things like this.
Steve in S.F. wrote:
> Thanks so much - I don't even find that function in help for either
> Access or Excel, but it definitely works!
>
> "Marshall Barton" wrote:
>
>> Steve in S.F. wrote:
>>
>>> 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)
>>
>> --
>> Marsh
>> MVP [MS Access]



 
Reply With Quote
 
Steve in S.F.
Guest
Posts: n/a
 
      25th Oct 2008
I should have thought of that -- Thanks!

"Mike Painter" wrote:

>
> Open a module and click on help. It will give you VBA information that
> contains things like this.
> Steve in S.F. wrote:
> > Thanks so much - I don't even find that function in help for either
> > Access or Excel, but it definitely works!
> >
> > "Marshall Barton" wrote:
> >
> >> Steve in S.F. wrote:
> >>
> >>> 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)
> >>
> >> --
> >> Marsh
> >> MVP [MS Access]

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create a calculated item based on a calculated field Stijn Microsoft Excel Misc 1 25th Aug 2008 05:30 PM
how to create a calculated field from another calculated field? =?Utf-8?B?RWxkb24=?= Microsoft Excel Misc 0 9th Jan 2006 04:40 PM
Criteria on field calculated form another calculated field Max Moor Microsoft Access Queries 1 22nd Dec 2004 09:19 AM
Pass Form Text Input Field to Separate Form Input Field =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 3 22nd Dec 2004 12:53 AM
Re: Calculated field that uses another calculated field - possible? Lynn Trapp Microsoft Access Queries 0 20th Apr 2004 06:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:10 AM.