Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
EricM EricM is offline
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
EricM EricM is offline
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
EricM EricM is offline
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating in text form fields Cranky[_2_] Microsoft Word Help 1 July 19th 07 07:10 AM
Word 2003 - Word is Calculating the Word Count B. Levien Microsoft Word Help 1 November 20th 06 06:27 PM
word 2003, formfields [email protected] Microsoft Word Help 3 September 12th 05 12:22 PM
How to search a word document based on text color ? Arvind Ramanathan Microsoft Word Help 1 June 1st 05 11:43 PM
word 2000 - Stopping users formfields resetting in a form Anne Microsoft Word Help 1 December 15th 04 02:20 AM


All times are GMT +1. The time now is 08:34 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"