Microsoft KB Archive/918574

= How to register or unregister ActiveX controls in Access 2007 =

Article ID: 918574

Article Last Modified on 11/3/2006

-

APPLIES TO


 * Microsoft Office Access 2007

-





This article applies to a Microsoft Access database (.mdb), a Microsoft Access project (.adp), and a Microsoft Access 2007 database (.accdb).



Moderate: Requires basic macro, coding, and interoperability skills.



INTRODUCTION
This article describes how to register or unregister an ActiveX control in Microsoft Office Access 2007.



MORE INFORMATION
In earlier versions of Access than Access 2007, you could register or unregister an ActiveX control by clicking ActiveX Controls on the Tools menu. In Access 2007, you cannot use this method. If you want to register or unregister an ActiveX control, use one of the following methods.

Method 1: Use Visual Basic code
To use Visual Basic code to register or unregister an ActiveX control, run the code directly in the Immediate window, or create a module that contains the code.

To run the Visual Basic code directly in the Immediate window, follow these steps:  In Access 2007, open a trusted database, or enable macros in the database. Press CTRL+G to open the Immediate window.  Type the following code, and then press ENTER. DoCmd.RunCommand acCmdRegisterActiveXControls 

To create a module that contains the Visual Basic code, follow these steps:  In Access 2007, open a trusted database, or enable macros in the database. On the Create tab, click Macro in the Other group, and then click Module.</li>  Create a subroutine that includes the following Visual Basic code. DoCmd.RunCommand acCmdRegisterActiveXControls </li> Press F5 to run the code.</li></ol>

Method 2: Use the RunCommand macro action

 * 1) In Access 2007, open a trusted database, or enable macros in the database.
 * 2) On the Create tab, click Macro in the Other group, and then click Macro.
 * 3) On the Design tab, click Show All Actions in the Show/Hide group.
 * 4) In the Action column, click RunCommand, and then click RegisterActiveXControls in the Command list.
 * 5) Click Save.
 * 6) In the Tools group, click Run.

Additional query words: kbOffice12p2 AC2007 ACC2007 Access2007

Keywords: kbhowto kbexpertisebeginner KB918574

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.