Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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! |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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" wrote in message ... 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! |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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! |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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! |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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" wrote in message ... 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! |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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! |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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! |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
calculating dates in a Word form
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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculating Dates | Mailmerge | |||
Calculating Age in Form | Microsoft Word Help | |||
Calculating dates in word tables | Tables | |||
Word table forumla for calculating dates | Tables | |||
Calculating form fields in Word. | Microsoft Word Help |