ACC: Error "Invalid key" When Adding Node to TreeView ControlLast reviewed: May 7, 1997Article ID: Q162858 |
The information in this article applies to:
SYMPTOMSAdvanced: Requires expert coding, interoperability, and multi-user skills. When you try to use the Add method of the Node object with the TreeView Custom Control, you may receive the following error message:
Run-time error '35603': Invalid keyNOTE: The TreeView control is only available if you have installed the Microsoft Access Developer's Toolkit version 7.0, or the Office 97 Developer Edition.
CAUSEThe Item Method, which can be used to return a specific member of the Nodes collection, takes one argument. If this argument is a numeric expression, the Item method searches for the Node by index; if the argument is a string expression, the Item method searches for the Node by key. Because this argument is a Variant, the Item method cannot distinguish a key expression from an index expression unless that expression contains at least one non- numeric character.
RESOLUTIONConcatenate at least one non-numeric character to the expression in the key argument of the Add method. For example, add a node by using
Set Node = Me!CustOrders.Nodes.Add(, , "Node " & rst!OrderID, CStr(rst!OrderID))instead of
Set Node = Me!CustOrders.Nodes.Add(, , rst!OrderID, CStr(rst!OrderID)) MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about the Add method of the Node object, search the Help Index for "Add Method," and then "Add Method (Nodes Collection)." For more information about the Item method, search the Help Index for "Item method." |
Keywords : IntpCstm kbcode kberrmsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |