This page shows you the easy and correct steps required to repair a Windows 2147467259 error. Check it out and finally get rid of this problem.
The Problem
When you try to open a form in Microsoft Access through the Automation feature and then SetFocus the custom menu bar for the form, this error message appears on the screen.
Solution
This is an error code in Microsoft Visual Basic which is caused when the menu bar cannot be viewed in the user interface when the Automation code is carried out. This causes the SetFocus to fail resulting in the error message.
You can try to correct the error by starting up Microsoft Access and then navigate to
C:\ folder and then
create a new database and name it
Db1.mdb. Click on
Macros under Objects in the Database window and then choose
New. When the prompt opens choose
Action and enter the
AddMenu actions under the
Action Arguments feature and then enter
Menu Name: Message Menu Macro Name: Macro2 Status Bar Text: .
Save the macro as Macro 1.
Next it is necessary to create an additional newmacro by choosing
View and then clicking on
Macro Names. Enter
Message under Macro Name and then enter
MsgBox under Action. Choose
Action Arguments and enter
Message: Hello Beep: Yes Type: None Title: .
Save this process as Macro2.Return to the window for the database and choose
Forms under the Objects feature. Choose
New and then click on
Design View and then choose
OK. To display the property sheet choose
View and then click on
Properties. When the property sheet is displayed choose
Other and then scroll down to
MenuBar and
set the property to Macro1. Save the property sheet as
Form1 and close the window.
Go to
Fileand click on
Close and then choose
New DatabaseC:\ folderand name the file
Db2.mdb. In this file choose
Modules, click on
NW and add this code:
Option Compare Database Option Explicit Dim objAccess As Access.Application Function AutomationTest ( ) Set objAccess = CreateObject (“Access.Application”) objAccess.Visible = True objAccess.OpenCurrentDatabase (“C:\Dbl.mdb”) objAccess.DoCmd.OpenForm "Form1" objAccess.CommandBars.ActiveMenuBar.Controls (1).SetFocus End Function.
Proceed to choose
Compile Db2under Debug and choose
Save Db2 on File menu.
Save this module as Module1. Choose
Run Sub/UserForm from the AutomationTest feature. Click on Microsoft Visual Basic after the second example of Microsoft Access to check for the error message.
TipFor more information, please see: How to fix Microsoft Visual Basic error #2147467259