Results 1 to 2 of 2

Thread: Can I instantiate a Nodes object independent of a TreeControl

  1. #1

    Thread Starter
    Addicted Member New2VB's Avatar
    Join Date
    Jun 2000
    Location
    Los Angeles
    Posts
    161

    Question

    I have the following code:
    Code:
    Public MyNodes As Nodes
    Private Sub Form_Load()
        Set MyNodes = New Nodes
        MyNodes.Add , , "First", "Title" + " Body"
    End Sub
    When I try to run it I get the following error
    "Compile error: Invalid use of new keyword."
    Alternately, if use the following code, I get a "Run-time error '91' message (i.e., Object variable or With block variable not set):
    Code:
    Public MyNodes As Nodes
    Private Sub Form_Load()
        MyNodes.Add , , "First", "Title" + " Body"
    End Sub
    What am I doing wrong? Or am I trying to do something that cannot be done even remotely in the way I am trying to do it?
    I appreciate any help or guidance anyone can offer.
    Regards,
    New2VB

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Nope, Nodes is probably instanced PublicNotcreatable so you can't create any using New keyword
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width