By default, Microsoft Access does not allow you to use an ActiveX control (ActiveX control: A control, such as a check box or button that offers options to users or runs macros or scripts that automate a task. You can write macros for the control in Microsoft Visual Basic for Applications or scripts in Microsoft Script Editor.) in expressions. It is possible, however, to enable the use of your ActiveX control in expressions when the ActiveX control has been added to a form. Follow these steps to enable the use of an ActiveX control in an expression:
- In the Database window, click Modules under Objects, and then click New on the Database window toolbar.
- Type the following code into the module:
SysCmd 14, "<ActiveX Control GUID>"
<ActiveX Control GUID> with the globally unique identifier (GUID) that identifies the ActiveX control that you want to enable in expressions.
- Press F5 to run the procedure.
The ActiveX control is added to the list of that Access allows to be used in expressions.
- You cannot remove an ActiveX control once it has been added to the list of allowed controls.
- Access allows the use of an ActiveX control in expressions only when the control has been added to a form and the ActiveX control has been loaded by the form. The ActiveX control cannot refer to a property or method of an ActiveX control that has not been added to the form.