Microsoft KB Archive/142843

= ACC: Form Name Err Msg Using Data Outline Control (95/97) =

Article ID: 142843

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q142843



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



SYMPTOMS
When you double-click a row in your Data Outline Control, you may receive the following error message:

The action or method requires a Form Name argument.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.



CAUSE
The Data Outline Control's FormName property for that level is blank.



RESOLUTION
You can either change the Data Outline Control to open a form at that level or create a Visual Basic for Applications procedure that will cancel the event if the FormName property is blank. To create this procedure, follow these steps:

 View the form containing the Data Outline Control in Design view and using the right mouse button (right-click), click the Data Outline Control. Click Build Event. Select RequestFormOpen in the Procedure (Proc:) list.  Add the following sample code to the Data Outline Control's RequestFormOpen event: Sub ActiveXCtl0_RequestFormOpen(Cancel As Integer, ByVal Level As _         Integer)

Dim L As Object Set L = Me![ActiveXCtl0].Object.Levelinfos If L(Level).FormName = "" Then Cancel = True End Sub This procedure prevents the Data Outline Control from trying to open the form if the FormName property is blank. 



Steps to Reproduce Behavior

 * 1) Open the sample database Northwind.mdb.
 * 2) Create a new, blank form.
 * 3) On the Insert menu, click ActiveX Control (or Custom Control in Microsoft Access 7.0).
 * 4) In the Insert ActiveX Control dialog box, select Data Outline Control 1.2 (or Data Outline Control 1.1 in Microsoft Access 7.0), and then click OK.
 * 5) On the Edit menu, click Data Outline Control 1.2 Object, and then click Properties.
 * 6) Click the Level One tab and type Categories in the RecordSource property.
 * 7) Type CategoryName in the DisplayFields property, and then click OK.
 * 8) View the form in Form view, and double-click any row in the Data Outline Control.

Keywords: kberrmsg kbprb kbprogramming KB142843

-

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

© Microsoft Corporation. All rights reserved.