ACC97: Input Masks Applied to Zip Code Field Ignored with Label WizardID: Q185970
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you use the Label Wizard to make mailing labels and include a zip code
field in the same row as other fields, input masks applied to the zip code
field are ignored.
Input masks can only apply to a single field in a single text box. When a text box on a report contains more than one field, the input masks for individual fields are ignored.
Use an immediate if (IIf) statement to format the output for the zip code field. You can change the ControlSource property of the text box that contains the zip code field in the report's Design view.
=Trim([City] & " " & [zip])
=Trim([City] & " " & IIf(Len([zip])=9,Left([zip],5) & "-" &
Right([zip],4),[zip]))
CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.
55555-1111
44444-
55555-2222
55455-
55155-
First Row: <FirstName> <LastName>
Second Row: <Address>
Third Row: <City> <Zip>
For more information about using input masks, search the Help Index for
"input masks," and then "Create an input mask to control how data is
entered in a field or control."
For more information about the IIf() function, see the following Knowledge
Base article:
Q106288 ACC: How to Use the IIf() (Immediate If) Function
Additional query words: prb zipcode zipcodes
Keywords : kbdta RptLabel
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 23, 1999