Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I have fields in my form and in text53 you type the date of birth. In
another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
You really don't want to know. It is immensely complicated and
incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Here's a link to macropods document ...
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Enjoy, Tony "Tony Jollans" My forename at my surname dot com wrote in message ... You really don't want to know. It is immensely complicated and incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#4
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I have been messing with that. However I don't know how to intermigle my
field where I type the date into it. How do I do it in VBA? "Tony Jollans" wrote: Here's a link to macropods document ... http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Enjoy, Tony "Tony Jollans" My forename at my surname dot com wrote in message ... You really don't want to know. It is immensely complicated and incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#5
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
See http://www.gmayor.com/insert_a_date_...than_today.htm
-- Enjoy, Tony "Chey" wrote in message ... I have been messing with that. However I don't know how to intermigle my field where I type the date into it. How do I do it in VBA? "Tony Jollans" wrote: Here's a link to macropods document ... http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Enjoy, Tony "Tony Jollans" My forename at my surname dot com wrote in message ... You really don't want to know. It is immensely complicated and incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#6
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
If you want, try this (I have no idea if it will work at all, especially
with a set of fields this complex): I'm assuming you are using a Word "online form" with form fields that look like { FORMTEXT } when you display field codes (e.g. using Alt-F9). Let's suppose you start with just two fields. The field you enter your date into is called "ed" (in the field properties, which you can access by right-clicking on the field. Make sure you check "calculate on exit" while you are in there) and you want to display the calculated date in another field called "cd" Set up your "cd" field so that it is a calculated field, and temporaily insert a calculation such as =ed (it won't work properly) When you unprotect the form and display the field codes, you should now see something like { FORMTEXT } { FORMTEXT {=ed } } Somewhere else in your document, insert the set of field codes you've worked out from macropod's article. If it isn't all nested inside a single { QUOTE } field, which if I remember correctly is macropod's usual approach, add a { QUOTE } field around the outside. Select that complete set of fields and paste it into the second FORMTEXT field so that it replaces {=ed} Protect your form and see what happens. -- Peter Jamieson http://tips.pjmsn.me.uk "Chey" wrote in message ... I have been messing with that. However I don't know how to intermigle my field where I type the date into it. How do I do it in VBA? "Tony Jollans" wrote: Here's a link to macropods document ... http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Enjoy, Tony "Tony Jollans" My forename at my surname dot com wrote in message ... You really don't want to know. It is immensely complicated and incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
#7
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
The construction for producing age from a date field is
{QUOTE {SET by {BirthDate \@ yyyy}} {SET bm {BirthDate \@ M}} {SET bd {BirthDate \@ d}} {SET yy {DATE \@ yyyy}} {SET mm {DATE \@ M}} {SET dd {DATE \@ d}} {SET md{=IF((mm=2),28+(mm=2)*((MOD(yy,4)=0)+(MOD(yy,400 )=0)-(MOD(yy,100)=0)),31-((mm=4)+(mm=6)+(mm=9)+(mm=11)))}} {Set Years{=yy-by-(mmbm)-(mm=bm)*(ddbd) \# 0}} {Set Months{=MOD(12+mm-bm-(ddbd),12) \# 0}} {Set Days{=MOD(md+dd-bd,md) \# 0}} "Your age is {Years} Year{IF{Years}= 1 "" s}, {Months} Month{IF{Months}= 1 "" s} and {Days} Day{IF{Days}= 1 "" s}."} With the field construction displayed (paste it from Macropod's document), use Replace to change BirthDate for Text53 (or better still rename Text53 to BirthDate) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Chey wrote: I have been messing with that. However I don't know how to intermigle my field where I type the date into it. How do I do it in VBA? "Tony Jollans" wrote: Here's a link to macropods document ... http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Enjoy, Tony "Tony Jollans" My forename at my surname dot com wrote in message ... You really don't want to know. It is immensely complicated and incomprehensible to ordinary mortals. MVP macropod has written a document on the subject but I don't have a handy link. Consider doing the calculations in a VBA macro, where it is pretty straightforward. -- Enjoy, Tony "Chey" wrote in message ... I have fields in my form and in text53 you type the date of birth. In another field I want to subtract the current date by text53 to get the person's age. How do I write the formula? Thanks Cheyenne |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to calculate a Future Date? | New Users | |||
Can I calculate a merged date field based on today plus # of days | Tables | |||
Calculate Age in table from Date of Birth and Current Date (MSWord | Tables | |||
How do I calculate a date from a merge field? | Mailmerge | |||
Calculate a date from days date | Microsoft Word Help |