Eyy

Slatting: Ending:

Wednesday, February 14. 20Ü1

Thursday, February 15, 2001

"rhe Total Days control is bound to the —1 Total Days field It shows the result of the values in the StartDate and End Date fields.

Figure 6.17 - Label controls on the Vacation Request form. When to Bind a Label Control

Generally, you bind Label controls to fields when you want to save the value to the item. For example, in the Vacation Request form, as shown in Figure 6-17, the Total Days label is bound to the TotalDays field. In this way, the value in the field is saved to the item when the item is saved or sent. However, also notice that Label2 and Label5 are not bound. As a result, the value in the Vacation Request field is not saved to the item. Rather, it exists in the form definition and is re-created each time an instance of the form is activated.

Set the Initial Value of a Label Control

In some cases, you may want to set the initial value of a Label control. For example, in the Vacation Request form, the TotalDays Label control on the Compose page contains a formula that automatically shows the result in the field.

To set the initial value of a Label control

1. In Design mode, right-click the control, and then click Properties on the shortcut menu.

2. Click the Value tab, and then type the initial value in the Initial Value text box, or click Edit to create an initial value formula.

® To automatically calculate a formula, click Calculate This Formula Automatically.

® To show the initial value in the Label control when the form is opened to create an item, click Calculate This Formula When I Compose A New Form.

Before you can set the initial value of a Label control, the control must be bound to a field. For more information, see "Bind a Control to an Existing Field," earlier in this chapter.

TextBox Controls

Use TextBox controls on a form to let the user enter, edit, and view information, as shown in Figure 6-18. For example, you can place a

TextBox control on a Compose page to let the user enter information and on the Read page to let the user view information.

In some cases, you may want to insert attachments, shortcuts, or hyperlinks. To do this, you must use the Message control. For more information about the Message control, see "Message Field" earlier in this chapter.

The TextBox control has a variety of display properties that give you great flexibility in determining how the TextBox control looks and functions. For example, you can specify the Multi-Line property so the user can enter more than one line of text in the control. Before you can specify the initial value for a control, it must be bound to a field.

Figure 6.18 - TextBox controls on the Business Card Request form. To specify the Multi-Line option for a TextBox control

1. In Design mode, right-click the control, and then click Properties on the shortcut menu.

2. Click the Display tab, and then select the Multi-Line check box.

Initial values for text boxes can be specified on the Value page of the Properties dialog box for that control.

To specify the initial value for a TextBox control

® On the Value page, type a value in the Initial Value text box or click Edit to build an initial value formula for the field.

Frame Controls

Use the Frame control to contain controls that are logically related, as shown in Figure 6-19. Frame controls are often used to contain OptionButton controls, but they can also contain other controls such as CheckBox, ComboBox, Label, and TextBox controls.

You can use the Frame control to create a line on the form. Set the height or width to 2, depending on whether it is a horizontal or vertical line.

Was this article helpful?

+1 0

Post a comment