OL97: How to Bind a Control to the Field of Another Control

ID: Q167187


The information in this article applies to:
  • Microsoft Outlook 97


SUMMARY

This article demonstrates how you can bind two controls to the same field by using the Microsoft Outlook 97 form design feature.


MORE INFORMATION

This example uses two form controls, a ComboBox and a TextBox. When you click to make a selection from the ComboBox list, the TextBox automatically displays the selected choice. The TextBox is bound to a field (Field2), whose value is automatically calculated from the value of the ComboBox field (Field1).

Creating the Form And the Controls

  1. Open your Inbox and then open a new message form.


  2. On the form Tools menu, click "Design Outlook Form" to enter the design mode.


  3. Click the (P.2) tab, and on the Form menu, click "Display This Page."


  4. On the Form menu, click "Control Toolbox" to display the Control Toolbox.


  5. Drag the ComboBox control to the P.2 page of the form.


  6. Drag the TextBox control to the P.2 page of the form.


Binding the ComboBox Control to a Field

The following steps bind a field, called Field1, to the ComboBox control. This field has the possible values of Red, Green, and Blue.
  1. In the P.2 form page, use your right-click the ComboBox and on the shortcut menu, click Properties.


  2. Click the Value tab and then click New, to create a new user-defined field.


  3. In the Name box, type Field1 and then click OK to return to the Properties dialog box. Field1 is an arbitrary user-defined field name.


  4. In the "Possible values" box, type Red;Blue;Green and click OK.


Binding the TextBox Control to the Same Field

The following steps also bind the TextBox control to the Field1 field.
  1. Right-click the TextBox control and on the shortcut menu, click Properties.


  2. Click the Value tab, click Choose Field, click User-defined fields in Inbox, and click the Field1 field.


  3. Click OK to close the Properties dialog box.


  4. On the Tools menu, click "Design Outlook Form" to exit the design mode.


When you click to select Red, Blue, or Green from the ComboBox, your selection automatically populates the TextBox.


REFERENCES

For more information about using fields and controls with Microsoft Outlook 97, please see the following article in the Microsoft Knowledge Base:

Q168975 OL97: How to Use Fields and Controls with VBScript
For more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base:
Q166368 OL97: How to Get Help Programming with Outlook
Q170783 OL97: Q&A: Questions about Customizing or Programming Outlook

Additional query words: OutSol

Keywords : FmsHowto
Version : 97
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: September 29, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.