@robertybob
Sorry to see you're not getting any responses here. (And that my above quote of part of your message apparently didn't work, but that's another story.)
I don't have a lot of experience with tree nodes, but it seems questionable that VB would suddenly use the name rather than the value of a variable, in evaluating such an expression. I'd suggest a more likely explanation is something like trying to use a variable out of scope.
For example, in your post you showed the definition of
thisnode immediately before where it was used. I realise this is for illustration purposes, and is probably not where things are actually located in the code. In the real world, could you have defined
thisnode in a different Sub or something, so the variable actually doesn't exist at the point where you used it? If that's the case, then VB would create a new variable called
thisnode, of the default type (variant I think). Since the new variable has no value, I belive that would result in you trying to reference
Treeview.Nodes.Item(0).Text.
(I'm assuming you're working with VB6. If you're using VB.Net it probably works differently, and you probably should ignore the following advice.)
To eliminate this as a possible source of your error, insert the code
Option Explicit at the top of each module (including forms). "explicit" means that you cannot use a variable without first creating it. Instead of just going ahead and creating a new variable for you, the compiler will report an error. You'd be amazed at how many bugs are prevented this way; a mis-typed variable name can be a tough thing to track down.
To prevent such problems in future (regardless of whether it was the cause of this particular issue) you should go to your options and turn on "Require variable declaration". That causes VB to insert Option Explicit in every new module from now on.