Form fields: multiple formats for FORMTEXT Numbers

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

Guest

I'm having the following difficulty
I need to create a form to collect personal information that will then be printed. In order to ensure consistency, I want to apply number formats to the various numbers I need to use. Two of these numbers might be collected in one of two formats

Phone number-
If an area code is provided, I would prefer the number to appear with this format: (123) 123-123
If there is no area code, I would prefer this format: 123-123

Zip Code-
If the zip+4 is provided, I would prefer the following format: 12345-123
If only the zip is provided, I would preferthis format: 0123

I can't seem to set up the FORMTEXT field to do this. If I place it inside of an IF field, Word no longer recognizes the field as FORMTEXT, and it is not available when I protect the document as a form

I've been working off of http://www.gmayor.com/formatting_word_fields.htm as my guide for formatting fields, but I can't seem to use it to find an answer for this particular problem. The technique offered in the US Zip Codes section isn't working for me when a FORMTEXT field is involved

tj
 
If I place a text formfield in an IF field so that it is displayed, it is
available when the form is protected but you can't tab into it; you can type
in it.

I believe that Word's formfields don't have formatting pictures for phone
numbers or zip codes. You have to break your numbers up into separate chunks
and use IF fields to display/hide the separators.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

tjtjjtjt said:
I'm having the following difficulty:
I need to create a form to collect personal information that will then be
printed. In order to ensure consistency, I want to apply number formats to
the various numbers I need to use. Two of these numbers might be collected
in one of two formats:
Phone number--
If an area code is provided, I would prefer the number to appear with this format: (123) 123-1234
If there is no area code, I would prefer this format: 123-1234

Zip Code--
If the zip+4 is provided, I would prefer the following format: 12345-1234
If only the zip is provided, I would preferthis format: 01234

I can't seem to set up the FORMTEXT field to do this. If I place it inside
of an IF field, Word no longer recognizes the field as FORMTEXT, and it is
not available when I protect the document as a form.
as my guide for formatting fields, but I can't seem to use it to find an
answer for this particular problem. The technique offered in the US Zip
Codes section isn't working for me when a FORMTEXT field is involved.
 
{ IF { Ref "Plus4" } <> "" "-" "" \* CharFormat }

Be sure to check the "calculate on exit" property for the Plus4 field. This
should work in any version beginning with Word 97 - and probably earlier.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

tjtjjtjt said:
I'll check out the web site you had beneath your name.
I'm not quite sure how I would go about using the IF field to show or hide
the symbols. Say, the dash for the zip code.
 
Back
Top