#1   Report Post  
Meryl
 
Posts: n/a
Default Field Codes

I've been messing with forms for too long today. I did go to the site that
many of you recommend such as:

http://addbalance.com/word/movetotemplate.htm
http://word.mvps.org/

I downloaded a couple of examples, but they didn't show what I was looking
for.

I managed to use Field codes to create an entry where you enter the birthday
and it prints your age. But then I lost it and when I tried to toggle field
codes, it would not come back because I had the data entered. I can't copy
field codes from another file and paste it in. Is there a way to do it so I
don't have to retype everything?

Plus, I would like the birth date to go into one table cell and the age in
another. I can only make them appear in the same cell using the Field code
insert. How do you separate them out?

I am sure macros are a good way to go... have not quite got them figured out
yet. Thanks.

Meryl
--
http://www.meryl.net/blog/
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

Date calculations using fields are complex. The instructions for doing this
and the field codes to copy to your document can be found at
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902. Based on this
article, you can amend the code to run from a form field. Call the formfield
BirthDate, set is properties as a date type of field and set the calculate
on exit check box. In the body of the text at the place ytou want the field,
you need to create the following construction. (Copy it from the
aforementioned article and paste it to your document - then amend it to
match. Simply copying from this newsgroup posting will not work).

{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)}}
{Years}" Year{IF{Years}= 1 "" s}"}

--

Graham Mayor - Word MVP

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




Meryl wrote:
I've been messing with forms for too long today. I did go to the site
that many of you recommend such as:

http://addbalance.com/word/movetotemplate.htm
http://word.mvps.org/

I downloaded a couple of examples, but they didn't show what I was
looking for.

I managed to use Field codes to create an entry where you enter the
birthday and it prints your age. But then I lost it and when I tried
to toggle field codes, it would not come back because I had the data
entered. I can't copy field codes from another file and paste it in.
Is there a way to do it so I don't have to retype everything?

Plus, I would like the birth date to go into one table cell and the
age in another. I can only make them appear in the same cell using
the Field code insert. How do you separate them out?

I am sure macros are a good way to go... have not quite got them
figured out yet. Thanks.

Meryl



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I turn off field codes in an MS Word document? Welshwoman Microsoft Word Help 7 March 2nd 05 05:15 PM
Toggle field codes. Frank Martin New Users 2 February 17th 05 03:11 AM
Typing If Field Codes a_ryan1972 Microsoft Word Help 11 February 4th 05 06:08 PM
HOW TO HIDE Field Codes automatically? sorazal Mailmerge 2 February 1st 05 10:33 PM
Word Field Codes in Excel data file mranz Mailmerge 7 December 11th 04 09:02 AM


All times are GMT +1. The time now is 09:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"