Home   |   Asp.Net 2.0   |   .Net Framework 2.0   |   IIS 6.0   |   Sql Server 2005   |   Visual Basic 2005   |   c# 2005   |   VS 2005   |   Visual Source Safe 2005

MS Dynamics CRM 3.0

SharePoint Portal Server 2003
SharePoint Server 2007
Dynamics NAV
Dynamics CRM
SharePoint Designer 2007
SharePoint Portal Server 2001
Windows SharePoint Services
Windows SharePoint Services 3.0
Project Server 2003
Project Server 2007
Dynamics – Point of Sale
Dynamics AX
Dynamics GP
Dynamics Retail Management System (RMS)
Dynamics SL
SQL Server 2000
Visual Basic .NET 2003
Visual C# .NET 2003
Visual C++ .NET 2003
Visual C++ 2005
Visual SourceSafe 6.0
Windows Server 2003
Windows Server 2003
Outlook 2003
ADO.NET 1.1
ASP.NET 1.0
Visual Studio Team Foundation Server
Visual Studio 2005 Team Edition
Windows Internet Explorer 7
BizTalk Server 2000
BizTalk Server 2002
BizTalk Server 2004
BizTalk Server 2006
Visual Studio 6.0
Access 2000
Access 2002
Access 2003
Access 2007
Access 97
Collaboration Data Objects 2.0
Commerce Server 2002
Content Management Server 2001
Commerce Server 2007
Content Management Server 2002
Data Access Components 2.7
Data Access Components 2.8
DirectX 9.0b
Office Small Business Accounting 2006
Accounting 2007
ActiveSync 4.1
Class Server 2.0
Groove 2007
Windows Vista
Outlook 2007
OneNote 2003
OneNote 2007
Office X for Mac
Zune software
Zune Live
Zoo Tycoon 2
Flight Simulator 2002
Dungeon Siege II

Cervo Technologies
The Right Source to Outsource

Oracle Database FAQS

Sharepoint Portal Server KB

Outlook 2007 Knowledge Base Articles

Access 2000 Knowledge Base Articles

You receive an error message when you start Visual Basic for Applications code in an Access database


When you start Microsoft Visual Basic for Applications (VBA) code in a Microsoft Access database, you may receive an error message that resembles the following:
The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE Server or ActiveX Control.

CAUSE

This issue may occur if the following conditions are true:
You create an event handler, a function, or a subroutine to start the VBA code in an Access form or report.
You run the VBA code on a computer that uses different non-Unicode language settings than the computer on which you created the event handler, the function, or the subroutine.
Note This issue may also occur if the VBA code contains accented characters or special characters. Additionally, this issue may occur if an object name in the Access database contains accented characters or special characters.

RESOLUTION

To resolve this issue, use the appropriate method.

Method 1: Verify the non-Unicode language

If you are running the VBA code on a Microsoft Windows XP-based computer or on a Windows 2000-based computer, you may be able to resolve this issue by changing the non-Unicode language setting on the computer where you are running the VBA code. To verify and to change the non-Unicode language setting, follow these steps.

Note Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.
1.Click Start, click Run, type Intl.cpl, and then click OK.
2.Under Language for non-Unicode programs on the Advanced tab, verify that the language matches the language on the computer on which you created the event handler, the function, or the subroutine. If the language differs, click the language that you want, and then click OK.
3.Restart the computer.

Method 2: Remove accented characters or special characters from the VBA code and from database objects

To resolve this issue, remove any accented characters or special characters that appear in the VBA code or in database objects. For example, form sections and report sections that were created in localized versions of Access may contain accented characters or special characters.

To rename an Access object, or a section in an Access object, that contains accented characters or special characters, follow these steps:
1.Start Access, and then open the database that you want.
2.Right-click the form or report that you want, and then click Design view.
3.Right-click the object that you want, and then click Properties.
4.On the All tab in the Name box, type a name that does not contain accented characters or special characters.
5.After you rename the objects, open Visual Basic Editor to determine whether your changes appear in the VBA code. The objects may retain the original names. If this behavior occurs, you must manually rename the objects in the VBA code.

Steps to reproduce the issue

1.Start Access on a computer where the Russian versions of Windows XP and Microsoft Office 2003 are installed.
2.Create a new Access database.
3.Add a form to the database. By default, a form that is named Form1 is created.
4. In Design view, add a command button to the form.
5.Right-click the command button that you added in step 4, and then add the following code example to the Click event for the command button.
  
On Error GoTo Err_cmdMsgBox_Click
MsgBox "Hello World"
Exit_cmdMsgBox_Click:
Exit Sub
Err_cmdMsgBox_Click:
MsgBox Err.Description
Resume Exit_cmdMsgBox_Click
 
6.Compile the Access database.
7.Close the Visual Basic code window, and then close the Access database.
8.On a computer where the English versions of Windows XP and Office 2003 are installed, verify that the non-Unicode language is set to English (United States).
9.Copy the Access database that you created in step 2 to the computer in step 8.
10.Open the Access database, open the form that contains the command button, and then click the command button to run the VBA code.


APPLIES TO
Microsoft Office Access 2003
Microsoft Access 2002 Standard Edition
Microsoft Access 2000 Standard Edition

Keywords: 
kbtshoot kbbug kbprb KB907337

Copyright © 2004 - 2007 Gridview.org, Inc. All rights reserved. Powered by Smart Web Content Management System