When you try to run a macro that uses the SetValue
action to set the Visible
property of one of the following objects, the macro may not run successfully:
- A form
- A check box control on a form or on a report
- A Bound object frame control on a form or on a report that is used to display OLE objects and to work with OLE objects that are stored in tables
Additionally, you may receive the following error message:
You don't have the license required to use this ActiveX control.
You tried to open a form containing an OLE object or an ActiveX control or you tried to create an ActiveX control.
To obtain the appropriate license, contact the company that provides the licensed OLE object or ActiveX control.
This problem may occur when you turn on sandbox mode for Microsoft Office Access 2003 applications.
property of the objects that are mentioned in the "Symptoms" section is blocked when you turn on sandbox mode.
To work around this problem, you must create a function to set the Visible
property of an object and then use a macro to run the function. To do this, follow these steps:
- Start Access 2003.
- Open your Access database (.mdb) or your Access project (.adp).
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- On the Insert menu, click Module.
- Type or paste the following code in the Visual Basic Editor:
Public Function SetVisible(frmTarget As Object, fValue As Boolean)
frmTarget.Visible = fValue
- On the File menu, click Save <Database Name>.
- In the Save As dialog box, type SetVisibleModule, and then click OK.
- Close the Visual Basic Editor.
- In the Database window, click Macros under the Objects section, and then click New.
- Create a new macro that is named SetVisibleMacro with the following action:
Note You must replace the <object reference> placeholder with the Visual Basic reference to the object. This is the object that has the Visible property that you want to set.
Macro Name : SetVisibleMacro
Action : RunCode
Function Name SetVisible (<object reference>, <True or False>)
For example, if you want to set the Visible property for the Form1 form to False, you must set the Function Name action argument to the following:
SetVisible (Forms!Form1, False)
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
For additional information about the Microsoft Jet Expression Service sandbox mode, visit the following Microsoft Web site:
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
How to configure Jet 4.0 to prevent unsafe functions from running in Access 2003
Article ID: 841916 - Last Review: July 28, 2006 - Revision: 3.3
- Microsoft Office Access 2003
|kbcode kbcontrol kbmacro kbfunctions kbenable kberrmsg kbbug KB841916|