Require a specific type of data
- In design mode, double-click the control whose data type you want to change.
- In the
Data type
box,
click the data type you want.
Note If a user types a value with the wrong data type, a standard inline alert will appear.
Note If your form template is based on a sample form or a pre-existing XML Schema, you might not be able to change the data type.
Require a specific value or range of values
- In design mode, select the control for which you want the validation to occur, and then click Data Validation on the Format menu.
- In the Data Validation dialog box, click Add.
- In the If this condition is true boxes, enter the condition.
- To add additional conditions, click
And, and then, in the rightmost box under
If this condition is true,
do one of the following:
- To show the error alert only when both conditions are true, click and.
- To show the error alert when one or both conditions are true, click or.
- In the Error alert type box, click the type of error alert you want to display to users.
- In the ScreenTip box, type the text you want to display when a user rests the insertion point on the control or right-clicks the control.
- In the Message box, type the text you want to display in the dialog box either immediately (if you chose a dialog box alert) or when the user requests more details (if you chose an inline alert).
To create an event function for a particular event in Office InfoPath 2003, you must associate the event with the correct field, and then write the script in Microsoft Script Editor (MSE). Because the event function is referred to in the form definition (.xsf) file, you should not create a new function entirely from within MSE. In addition, you should not modify the event function name or its arguments.
- In design mode, select the control for which you want the validation to occur, and then click Data Validation on the Format menu.
- In the
Events list in the
Data Validation dialog box, click the
event you want to create or modify, and then click
Edit.
Note This opens Microsoft Script Editor and positions the cursor at the specified event.
- In Microsoft Script Editor, type the script that you want to run when the event occurs.
- On the File menu, click Save, and then click Exit.