ACC2000: Input Masks Applied to Zip Code Field Ignored with Label Wizard (197588)
The information in this article applies to:
This article was previously published under Q197588 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the Label Wizard to make mailing labels, and you include a zip
code field in the same row as other fields, input masks that you apply to
the zip code field are ignored.
CAUSE
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.
RESOLUTION
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.
Using an Immediate IF to Format a Text Field- Create the Labels Employees: Report by following the steps in the "Steps to Reproduce Behavior" section later in this article.
- Right-click the last text box in the Labels Employees: Report, and then click Properties on the menu that appears.
- In the Properties dialog box, click the Data tab, click in the ControlSource property box, and then click the Build button to the right of the ControlSource property box to open the Expression Builder.
- In the Expression Builder, change the existing formula
=Trim([City] & " " & [zip])
=Trim([City] & " " & IIf(Len([zip])=9,Left([zip],5) & "-" &
Right([zip],4),[zip]))
- Click OK to close the Expression Builder.
- Close the property sheet.
- On the File menu, click Save to save the report.
- On the File menu, click Print Preview to run the report.
REFERENCESFor more information about using input masks, click Microsoft Access Help on the Help menu, type Create an input mask to control how data is enteredin a field or control in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For additional information about the IIf() function, click the article number below
to view the article in the Microsoft Knowledge Base:
209192 ACC2000: How to Use the IIf() (Immediate If) Function
Modification Type: | Major | Last Reviewed: | 6/30/2004 |
---|
Keywords: | kbprb KB197588 |
---|
|