PC Review


Reply
Thread Tools Rate Thread

calculating dates in a Word form

 
 
mbrancheau
Guest
Posts: n/a
 
      15th Jan 2009
Is there a way I can insert a date into a form field, and then have that date
update other, different dates? Specifically, I want the people using my form
to insert a project due date, then the form will populate a timeline of
different dates based on the due date for when the steps of the project need
to be completed.

Thanks!
 
Reply With Quote
 
 
 
 
Jay Freedman
Guest
Posts: n/a
 
      15th Jan 2009
mbrancheau wrote:
> Is there a way I can insert a date into a form field, and then have
> that date update other, different dates? Specifically, I want the
> people using my form to insert a project due date, then the form will
> populate a timeline of different dates based on the due date for when
> the steps of the project need to be completed.
>
> Thanks!


See
http://www.wopr.com/cgi-bin/w3t/show...&Number=249902.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


 
Reply With Quote
 
macropod
Guest
Posts: n/a
 
      15th Jan 2009
Hi mbrancheau,

To see how to do this and just about everything else you might want to do with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the items titled 'Date and Time Calculations In A Word Form' and 'Calculate a Date Sequence'. Do read the
document's introductory material.

--
Cheers
macropod
[MVP - Microsoft Word]


"mbrancheau" <(E-Mail Removed)> wrote in message news:ACD8C5E1-216E-48C0-85B2-(E-Mail Removed)...
> Is there a way I can insert a date into a form field, and then have that date
> update other, different dates? Specifically, I want the people using my form
> to insert a project due date, then the form will populate a timeline of
> different dates based on the due date for when the steps of the project need
> to be completed.
>
> Thanks!


 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      16th Jan 2009
Though my fellow MVPs have pointed the way, you might like to insert the
date from a calendar - see http://www.gmayor.com/popup_calendar.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


mbrancheau wrote:
> Is there a way I can insert a date into a form field, and then have
> that date update other, different dates? Specifically, I want the
> people using my form to insert a project due date, then the form will
> populate a timeline of different dates based on the due date for when
> the steps of the project need to be completed.
>
> Thanks!



 
Reply With Quote
 
Silfver
Guest
Posts: n/a
 
      14th Mar 2009
Concerning dates in Word Form and DateCalc 'tutorial':
Is there a way to call forand use the value from a form DropDown List Box
instead of use the SET Delay xx value in the field code given in DateCalc
examples?

/Silfver

*****

"Graham Mayor" wrote:

> Though my fellow MVPs have pointed the way, you might like to insert the
> date from a calendar - see http://www.gmayor.com/popup_calendar.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> mbrancheau wrote:
> > Is there a way I can insert a date into a form field, and then have
> > that date update other, different dates? Specifically, I want the
> > people using my form to insert a project due date, then the form will
> > populate a timeline of different dates based on the due date for when
> > the steps of the project need to be completed.
> >
> > Thanks!

>
>
>

 
Reply With Quote
 
Doug Robbins - Word MVP on news.microsoft.com
Guest
Posts: n/a
 
      14th Mar 2009
Probably easier to have a macro that runs on exit from the dropdown that
uses the .Result of the dropdown in the DateAdd function

Assuming that the start date was in a formfield with the bookmark name of
StartDate and the dropdown has the bookmark Interval (which is specified in
days) and you want the result to appear in a formfield with the bookmark
name of EndDate, use

With ActiveDocument
.FormFields("EndDate").result = Format(DateAdd("d",
..FormFields("Interval").result, _
.FormFields("StartDate").result), "d MMMM yyyy")
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Silfver" <(E-Mail Removed)> wrote in message
news:C50B3985-FFB0-47EF-AB8B-(E-Mail Removed)...
> Concerning dates in Word Form and DateCalc 'tutorial':
> Is there a way to call forand use the value from a form DropDown List Box
> instead of use the SET Delay xx value in the field code given in DateCalc
> examples?
>
> /Silfver
>
> *****
>
> "Graham Mayor" wrote:
>
>> Though my fellow MVPs have pointed the way, you might like to insert the
>> date from a calendar - see http://www.gmayor.com/popup_calendar.htm
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> mbrancheau wrote:
>> > Is there a way I can insert a date into a form field, and then have
>> > that date update other, different dates? Specifically, I want the
>> > people using my form to insert a project due date, then the form will
>> > populate a timeline of different dates based on the due date for when
>> > the steps of the project need to be completed.
>> >
>> > Thanks!

>>
>>
>>



 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      15th Mar 2009
As Doug says it is easier to use a macro run on exit from a field to insert
a required date, but it is also possible to use the numeric value from the
dropdown field in the datecalc calculation. If we assume that the Dropdown
field with the delays is bookmarked Dropdown1, set its calculate on exit
check box and in the datecalculation use {SET Delay { REF Dropdown1 }}

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Silfver wrote:
> Concerning dates in Word Form and DateCalc 'tutorial':
> Is there a way to call forand use the value from a form DropDown List
> Box instead of use the SET Delay xx value in the field code given in
> DateCalc examples?
>
> /Silfver
>
> *****
>
> "Graham Mayor" wrote:
>
>> Though my fellow MVPs have pointed the way, you might like to insert
>> the date from a calendar - see
>> http://www.gmayor.com/popup_calendar.htm
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> mbrancheau wrote:
>>> Is there a way I can insert a date into a form field, and then have
>>> that date update other, different dates? Specifically, I want the
>>> people using my form to insert a project due date, then the form
>>> will populate a timeline of different dates based on the due date
>>> for when the steps of the project need to be completed.
>>>
>>> Thanks!



 
Reply With Quote
 
Silfver
Guest
Posts: n/a
 
      16th May 2009
Thanks Macropod and Graham Mayor. I have followed your field codes and tip
concerning calculating dates in a Word document. Works very well so now I can
choose among four different delay days from a field list box and let the Date
Calc code calculate from that.

I wanted to use Macropods field code examples (Date Calc) instead of macros
with VBA, because some friends that will use my documents not will deal with
VBA on their computers.

While it works so well I will try experimenting with the even more and
elegant code Handling Weekends and Holidays if a calculated date will end up
on a weekend or holiday.

But here in Sweden we have little different Holidays than in Australian
Capital Territory as in the code example.

We have not so many Holidays as in ACT, no Anzac and so on. Instead we have
some special Swedish Holidays. Christmas nearly the same, but our
correspondence day to Boxing Day is always on 26th December independent of
Saturday-Sunday. Easter seems to be the same. But then we have Ascension Day
as a holiday, always on a Thursday, calculated depending on Easter Day. And
then some Holidays on fixed dates. And some that always fall on a Saturday or
Sunday, so them I need not to calculate anyway.

I have some questions on how to change in the Following Business Day code by
Macropod to adapting for Swedish calendar:

1. Can I just erase from the code the ACT dependent holidays?
2. How to add code for Swedish holidays. Some hints..?
3. Do I have to change the SET Adj… code rows in any way?

Hoping for some hints…

/Silfver


"Graham Mayor" wrote:

> As Doug says it is easier to use a macro run on exit from a field to insert
> a required date, but it is also possible to use the numeric value from the
> dropdown field in the datecalc calculation. If we assume that the Dropdown
> field with the delays is bookmarked Dropdown1, set its calculate on exit
> check box and in the datecalculation use {SET Delay { REF Dropdown1 }}
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Silfver wrote:
> > Concerning dates in Word Form and DateCalc 'tutorial':
> > Is there a way to call forand use the value from a form DropDown List
> > Box instead of use the SET Delay xx value in the field code given in
> > DateCalc examples?
> >
> > /Silfver
> >
> > *****
> >
> > "Graham Mayor" wrote:
> >
> >> Though my fellow MVPs have pointed the way, you might like to insert
> >> the date from a calendar - see
> >> http://www.gmayor.com/popup_calendar.htm
> >>
> >> --
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >> Graham Mayor - Word MVP
> >>
> >> My web site www.gmayor.com
> >> Word MVP web site http://word.mvps.org
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>
> >>
> >> mbrancheau wrote:
> >>> Is there a way I can insert a date into a form field, and then have
> >>> that date update other, different dates? Specifically, I want the
> >>> people using my form to insert a project due date, then the form
> >>> will populate a timeline of different dates based on the due date
> >>> for when the steps of the project need to be completed.
> >>>
> >>> Thanks!

>
>
>

 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      17th May 2009
Macropod is from Australia thus has based the codes on dates with which he
uses at home. The field samples explain how to create fixed holidays. You
can replace the examples with your own and remove (all references to) those
that don't apply.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Silfver wrote:
> Thanks Macropod and Graham Mayor. I have followed your field codes
> and tip concerning calculating dates in a Word document. Works very
> well so now I can choose among four different delay days from a field
> list box and let the Date Calc code calculate from that.
>
> I wanted to use Macropods field code examples (Date Calc) instead of
> macros with VBA, because some friends that will use my documents not
> will deal with VBA on their computers.
>
> While it works so well I will try experimenting with the even more and
> elegant code Handling Weekends and Holidays if a calculated date will
> end up on a weekend or holiday.
>
> But here in Sweden we have little different Holidays than in
> Australian Capital Territory as in the code example.
>
> We have not so many Holidays as in ACT, no Anzac and so on. Instead
> we have some special Swedish Holidays. Christmas nearly the same, but
> our correspondence day to Boxing Day is always on 26th December
> independent of Saturday-Sunday. Easter seems to be the same. But then
> we have Ascension Day as a holiday, always on a Thursday, calculated
> depending on Easter Day. And then some Holidays on fixed dates. And
> some that always fall on a Saturday or Sunday, so them I need not to
> calculate anyway.
>
> I have some questions on how to change in the Following Business Day
> code by Macropod to adapting for Swedish calendar:
>
> 1. Can I just erase from the code the ACT dependent holidays?
> 2. How to add code for Swedish holidays. Some hints..?
> 3. Do I have to change the SET Adj. code rows in any way?
>
> Hoping for some hints.
>
> /Silfver
>
>
> "Graham Mayor" wrote:
>
>> As Doug says it is easier to use a macro run on exit from a field to
>> insert a required date, but it is also possible to use the numeric
>> value from the dropdown field in the datecalc calculation. If we
>> assume that the Dropdown field with the delays is bookmarked
>> Dropdown1, set its calculate on exit check box and in the
>> datecalculation use {SET Delay { REF Dropdown1 }}
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> Silfver wrote:
>>> Concerning dates in Word Form and DateCalc 'tutorial':
>>> Is there a way to call forand use the value from a form DropDown
>>> List Box instead of use the SET Delay xx value in the field code
>>> given in DateCalc examples?
>>>
>>> /Silfver
>>>
>>> *****
>>>
>>> "Graham Mayor" wrote:
>>>
>>>> Though my fellow MVPs have pointed the way, you might like to
>>>> insert the date from a calendar - see
>>>> http://www.gmayor.com/popup_calendar.htm
>>>>
>>>> --
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>> Graham Mayor - Word MVP
>>>>
>>>> My web site www.gmayor.com
>>>> Word MVP web site http://word.mvps.org
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>>
>>>>
>>>> mbrancheau wrote:
>>>>> Is there a way I can insert a date into a form field, and then
>>>>> have that date update other, different dates? Specifically, I
>>>>> want the people using my form to insert a project due date, then
>>>>> the form will populate a timeline of different dates based on the
>>>>> due date for when the steps of the project need to be completed.
>>>>>
>>>>> Thanks!



 
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
Calculating age in a Word template/Form from the DOB field John Microsoft Word Document Management 2 13th Jan 2010 12:10 AM
Converting and Calculating Dates on a Form FA Microsoft Access Forms 0 7th Dec 2005 04:08 PM
Converting and Calculating Dates on a Form FA Microsoft Access Forms 3 5th Dec 2005 08:19 PM
Calculating form fields in Word. =?Utf-8?B?SFJSZWNydWl0ZXI=?= Microsoft Word Document Management 1 4th Jan 2005 07:54 PM
Calculating dates - Need to calculate years and months between source dates. jmw748 Microsoft Access Queries 2 7th Jan 2004 12:31 PM


Features
 

Advertising
 

Newsgroups
 


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