In addition to the standard built-in controls that appear in the toolbox, Microsoft Access supports ActiveX controls, formerly called OLE controls or custom controls. An ActiveX control, like a built-in control, is an object that you place on a form to display data or perform an action. However, unlike a built-in control, the code that supports the ActiveX control is stored in a separate file or files which you must install in order to use the control.
The following ActiveX controls are available for you to use with Microsoft Access:
See Also For more information on using the WebBrowser control, see Chapter 21, “Developing Applications for the Internet and the World Wide Web.”
There are 14 other ActiveX controls available in Microsoft Office 97, Developer Edition and any number of controls are available from third-party vendors.
Some ActiveX controls, including the Calendar control and the WebBrowser control, are automatically registered with the system when you install the control files. Others must be registered manually. Once the control has been registered, you can add it to a form that is open in Design view.
You can use the methods, events, and properties associated with a control to manipulate the control’s appearance and behavior. In addition, many ActiveX controls can be data-bound—they can store or display data from a field in the form’s underlying table or query.
Note If you distribute an application that uses ActiveX controls, you must make sure that the controls are installed on each computer that runs your application.
Other applications that support ActiveX technologies, such as Microsoft Word, Microsoft Excel, or Microsoft Visual Basic, can also support ActiveX controls just like Microsoft Access. However, each application may support a different subset of ActiveX technologies. For this reason, controls that work in some applications may not work in others.
For example, if you’ve installed Visual Basic or Microsoft Office and the ActiveX controls they include, you may have several ActiveX controls that don’t work in Microsoft Access. When you add a control to a form, you may see controls in the list of ActiveX controls that aren’t compatible with Microsoft Access. Using a control that hasn’t been certified for use with Microsoft Access can cause unpredictable results.
To determine whether a specific ActiveX control is compatible with Microsoft Access, see the documentation provided with the control or contact the vendor of the control. In addition, if you insert an ActiveX control on a Microsoft Access form and get the “No Object in this Control” error, you most likely have selected a control that is not supported.
See Also For more information on which ActiveX controls are compatible with Microsoft Access, search the Help index for “ActiveX controls.”
There are two types of ActiveX controls. The first type is visible both at design time and at run time. An example of this type of ActiveX control is the Calendar control included with Microsoft Access. The Calendar control displays a calendar for a particular month in a particular year, as shown in the following illustration.
After you install the required files, you can place this control on your form. You can use the methods, events, and properties of the Calendar control to:
The second type of ActiveX control is visible only at design time. Typically, this type of control is provided to simplify interaction between a Microsoft Access application and one or more dynamic-link libraries (DLLs) or executable files. The Microsoft ImageList control and the Microsoft Common Dialog control included in Microsoft Office 97, Developer Edition are examples of this type of ActiveX control.