ACC: How to Programmatically Change a Control TypeLast reviewed: August 29, 1997Article ID: Q135381 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article demonstrates how you can programmatically change a control on a form to another type of control. Using the ControlType property in Visual Basic for Applications, you can change a text box into a combo box, a toggle button into an option button, and so on. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.
MORE INFORMATIONThe method described in this article uses a custom Visual Basic function (called from a command button on Form1) to change the ControlType property of a text box (on Form2) to a combo box. Two forms are necessary because the ControlType property is available only in a form's Design view. As a result, you cannot change a control's type using Visual Basic while the form that contains the control is open in Form view. To programmatically change a form's control to another type of control, follow these steps:
REFERENCESFor more information about the ControlType property, search the Help Index for "ControlType."
|
Additional query words: morph morphing morphed
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |