Text Form Field question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Word 2003. I have a text form field named Text1, regular text,
length limited to three characters, fill in enabled, calculate on exit
enabled. The form is protected.

With the following in Ctrl-F9 braces:

{ IF { Text1 } = “45C†“Lake County†}{ IF { Text1 } = “45D†“Lake Districtâ€
}{ IF { Text1 } = “49C†“Marion County†}

If I type 45 and anything after it (e.g. 45A or 45B or 45C or 45D or 45E,
etc.) I get the response of “Lake CountyLake Districtâ€.

If I type 49 and anything after it (e.g. 45A or 45B or 45C or 45D or 45E,
etc.) I get the response of “Marion Countyâ€.

How do I make it check for the correct third character?
 
Hi Ray-

It appears there is a problem with your syntax/phrasing for a nested IF.
Perhaps this example will put you on the right track:

In this example, special rates are offered only to residents of California
or Washington. If the State field specifies any other state, no additional
text is printed because no alternative text has been specified in the second
IF field.

{IF {MERGEFIELD State} = "CA" "For California residents, we offer special
rates to Asia and Japan." "{IF {MERGEFIELD State} = "WA" "For Washington
residents, we offer special rates to Asia and Japan." " "} "}

HTH |:>)
 
These are not mergefields but REF fields and it is not essential to put an
alternative in a conditional field. If there is no alternative nothing is
entered when the condition is not met. What was originally posted should
work, but doesn't. Unfortunately I don't see a simple solution while letters
and numbers are used in the field result.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
This has all the hallmarks of a "feature". You can get round it by creating
a temporary variable/bookmark with a leading non-numric character ...

{ Set Temp1 "A{ Text1 }" }{ IF { Temp1 } = "A45C" "Lake County" }{ IF {
Temp1 } = "A45D" "Lake District" }{ IF { Temp1 } = "A49C" "Marion County" }

(all braces via Ctrl+F9 of course)
 
Nice one :)

If I may venture an improvement

{ Set Temp1 "A{ Text1 \*Upper }" }{ IF { Temp1 } = "A45C" "Lake County" }{
IF {
Temp1 } = "A45D" "Lake District" }{ IF { Temp1 } = "A49C" "Marion County" }

will ensure that whether users enter 45c or 45C etc the correct result will
apply.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thanks, and good improvement.

--
Enjoy,
Tony


Graham Mayor said:
Nice one :)

If I may venture an improvement

{ Set Temp1 "A{ Text1 \*Upper }" }{ IF { Temp1 } = "A45C" "Lake County" }{
IF {
Temp1 } = "A45D" "Lake District" }{ IF { Temp1 } = "A49C" "Marion County" }

will ensure that whether users enter 45c or 45C etc the correct result will
apply.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thanks to both of you. Graham, I'd already fixed the "c" vs. "C" problem by
making the original convert to all caps, but that's a good thing to keep in
mind.

-Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top