ACC2002: Access Quits When You Set the ControlSource Property on a Data Access Page (295257)
The information in this article applies to:
This article was previously published under Q295257 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
On a data access page, when you set the control source of a text box or a Bound SPAN to an expression that references the HTML document object, Microsoft Access may stop responding, or you may receive the following error message, and then Microsoft Access quits:
Microsoft Access has encountered a problem and needs to close.
We are sorry for the inconvenience.
CAUSE
Possible causes of this problem may include using a control source that references one of the following:
- document.all("ControlName").value, where ControlName is the name of a control on the page
- document.title
RESOLUTION
Use script to fill the control. For an example of how to do so, follow these steps. CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database. - Start Access, and then open the sample database Northwind.mdb.
- Open the Employees data access page in Design view.
- If the toolbox is not already visible, click Toolbox on the View menu.
- Add a new text box to the page, and then set the following property:
- On the Tools menu, point to Macro, and then click Microsoft Script Editor.
- In the Client Objects & Events box, click MSODSC in the list. Click Current in the list of events.IMPORTANT: When you create VBScript blocks for MSODSC events, you must add a parameter to the event name as follows:
<SCRIPT LANGUAGE=vbscript FOR=MSODSC EVENT=Current(oEventInfo)> The <I>oEventInfo</I> parameter returns specific information about the event to the script. You must add this parameter, whether or not it will be used, because the script will not work without it.
- Type or paste the following line in the Script Editor between the SCRIPT tags.
txtValueTest.value = ReportsTo.value
- Save the changes, and then view the data access page in Page view.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 9/27/2006 |
---|
Keywords: | kbbug kberrmsg kbnofix KB295257 |
---|
|