ACC: Form Name Err Msg Using Data Outline Control (95/97)
ID: Q142843
|
The information in this article applies to:
-
Microsoft Access versions 7.0, 97
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
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.
MORE INFORMATIONSteps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- Create a new, blank form.
- On the Insert menu, click ActiveX Control (or Custom Control in
Microsoft Access 7.0).
- 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.
- On the Edit menu, click Data Outline Control 1.2 Object, and then
click Properties.
- Click the Level One tab and type Categories in the RecordSource property.
- Type CategoryName in the DisplayFields
property, and then click OK.
- View the form in Form view, and double-click any row in the Data Outline
Control.
Additional query words:
Keywords : kberrmsg kbprg PgmObj
Version : WINDOWS:7.0,97
Platform : WINDOWS
Issue type : kbprb
|