View Single Post
  #7   Report Post  
Ray_Johnson
 
Posts: n/a
Default Text Form Field question

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

"Tony Jollans" wrote:

Thanks, and good improvement.

--
Enjoy,
Tony


"Graham Mayor" wrote in message
...
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
Word MVP web site http://word.mvps.org


Tony Jollans wrote:
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)


"Graham Mayor" wrote in message
...
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
Word MVP web site http://word.mvps.org


CyberTaz wrote:
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 |:)

"Ray_Johnson" wrote:

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?