Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 2003
I use Word 2003. I've seen a lot of examples for math using formfields and
mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 2003
Leave out the commas. The fields should work as you've written them, with
that exception. -- 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. ericm wrote: I use Word 2003. I've seen a lot of examples for math using formfields and mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 200
I tried that. I set up my test document like this :
I opened a new document and clicked on the "text form field" box three times, so I have three form fields ready to use, and they're automatically named Text1, Text2, Text3. I then edit (right-click/Properties) the Text3 formfield : I change the TYPE to Calculation, and change the EXPRESSION to one of the following : =if(Text1="Dog" "Has Four Legs" "") or =if(Text1="Dog","Has Four Legs","") I always get a syntax error on the quotes, so it's not the commas. Further if I change the EXPRESSION to this by removing quotes : =if(Text1=Dog,1,2) I get the Undefined Bookmark, Dog error. What to do? Thanks. - Eric -------------------------------------- "Jay Freedman" wrote: Leave out the commas. The fields should work as you've written them, with that exception. -- 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. ericm wrote: I use Word 2003. I've seen a lot of examples for math using formfields and mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 200
Why are you using a calculated field at all? You can use an ordinary IF
field in the document (not in a form field), but note that the syntax of IF fields does not include or tolerate commas between TrueText and FalseText. Be sure to check "Calculate on exit" in the Form Field Options for the text form fields. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "ericm" wrote in message ... I tried that. I set up my test document like this : I opened a new document and clicked on the "text form field" box three times, so I have three form fields ready to use, and they're automatically named Text1, Text2, Text3. I then edit (right-click/Properties) the Text3 formfield : I change the TYPE to Calculation, and change the EXPRESSION to one of the following : =if(Text1="Dog" "Has Four Legs" "") or =if(Text1="Dog","Has Four Legs","") I always get a syntax error on the quotes, so it's not the commas. Further if I change the EXPRESSION to this by removing quotes : =if(Text1=Dog,1,2) I get the Undefined Bookmark, Dog error. What to do? Thanks. - Eric -------------------------------------- "Jay Freedman" wrote: Leave out the commas. The fields should work as you've written them, with that exception. -- 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. ericm wrote: I use Word 2003. I've seen a lot of examples for math using formfields and mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 200
Great! It works!
Thank you. I'm new to all this. I have another question, related to your answer. How do I reference a bookmark in the TrueText or FalseText? For example how do I get : if m2 1 HCPC "" to work? Meaning if the value in the formfield named m2 is greater than 1 then display the value in the formfield named HCPC, else display nothing. Thank you. "Suzanne S. Barnhill" wrote: Why are you using a calculated field at all? You can use an ordinary IF field in the document (not in a form field), but note that the syntax of IF fields does not include or tolerate commas between TrueText and FalseText. Be sure to check "Calculate on exit" in the Form Field Options for the text form fields. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "ericm" wrote in message ... I tried that. I set up my test document like this : I opened a new document and clicked on the "text form field" box three times, so I have three form fields ready to use, and they're automatically named Text1, Text2, Text3. I then edit (right-click/Properties) the Text3 formfield : I change the TYPE to Calculation, and change the EXPRESSION to one of the following : =if(Text1="Dog" "Has Four Legs" "") or =if(Text1="Dog","Has Four Legs","") I always get a syntax error on the quotes, so it's not the commas. Further if I change the EXPRESSION to this by removing quotes : =if(Text1=Dog,1,2) I get the Undefined Bookmark, Dog error. What to do? Thanks. - Eric -------------------------------------- "Jay Freedman" wrote: Leave out the commas. The fields should work as you've written them, with that exception. -- 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. ericm wrote: I use Word 2003. I've seen a lot of examples for math using formfields and mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Calculating based on text expressions in formfields - Word 200
Select the bookmark name and press Ctrl+F9, so you wind up with a
field nested within a field. Note that a field containing just a bookmark name is really a Ref field; the keyword Ref is optional. So you'll see the field code {if m2 1 {HCPC} ""} and the inner field will evaluate to the content of the bookmark named HCPC. On Tue, 9 Oct 2007 17:28:02 -0700, ericm wrote: Great! It works! Thank you. I'm new to all this. I have another question, related to your answer. How do I reference a bookmark in the TrueText or FalseText? For example how do I get : if m2 1 HCPC "" to work? Meaning if the value in the formfield named m2 is greater than 1 then display the value in the formfield named HCPC, else display nothing. Thank you. "Suzanne S. Barnhill" wrote: Why are you using a calculated field at all? You can use an ordinary IF field in the document (not in a form field), but note that the syntax of IF fields does not include or tolerate commas between TrueText and FalseText. Be sure to check "Calculate on exit" in the Form Field Options for the text form fields. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "ericm" wrote in message ... I tried that. I set up my test document like this : I opened a new document and clicked on the "text form field" box three times, so I have three form fields ready to use, and they're automatically named Text1, Text2, Text3. I then edit (right-click/Properties) the Text3 formfield : I change the TYPE to Calculation, and change the EXPRESSION to one of the following : =if(Text1="Dog" "Has Four Legs" "") or =if(Text1="Dog","Has Four Legs","") I always get a syntax error on the quotes, so it's not the commas. Further if I change the EXPRESSION to this by removing quotes : =if(Text1=Dog,1,2) I get the Undefined Bookmark, Dog error. What to do? Thanks. - Eric -------------------------------------- "Jay Freedman" wrote: Leave out the commas. The fields should work as you've written them, with that exception. -- 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. ericm wrote: I use Word 2003. I've seen a lot of examples for math using formfields and mergefields, but what if I want to evaluate an entry in one formfield in order to diaplay certain TEXT in another formfield. If you can follow my example, if it makes sense, what I'd like to do is this : For the formfield named Text 2, the equation I want is this : =if(Text11,"12","") In other words, if Text1 is greater than 1, then Text2 should display "12", else Text2 should display nothing. Instead of a result, I get a syntax error on the quotes. --------- Also what if I want to evaluate a TEXT entry in one formfield in order to perform a calculation or display TEXT in another formfield? For example, what's not working is this, for example in the formfield named Text2 : =if(Text1="dog","has four legs",if(Text1="man","has two legs","")). I get a syntax error on the quotes. The above equation reads (I hope) as this : If Text1 equals "dog", then Text2 displays "has four legs". If Text1 equals "man", then Text2 displays "has two legs". If Text1 equals neither "dog" or "man", then Text2 displays nothing. What do I do? Thanks. - Eric -- 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculating in text form fields | Microsoft Word Help | |||
Word 2003 - Word is Calculating the Word Count | Microsoft Word Help | |||
word 2003, formfields | Microsoft Word Help | |||
How to search a word document based on text color ? | Microsoft Word Help | |||
word 2000 - Stopping users formfields resetting in a form | Microsoft Word Help |