How can I test (in VBA code) if an object is set to Nothing.
Specifically, I'm trying to check whether I've yet saved a node from a
treeview control so that I can remember where I've been in code to
change the selected node when a node is collapsed?
At present, the relevant bits of my code are:
Option Compare Database
Option Explicit
Dim nodPrevious As Node
-----------------------
Private Sub tvwWP_NodeClick(ByVal Node As Object)
Dim ...
'Save this node for collapse
Set nodPrevious = Node
'Filter Risks by the selected node on the form
....
End Sub
------------------------
Private Sub tvwWP_Collapse(ByVal Node As Object)
Dim ...
If Not nodPrevious = Nothing Then '*** THIS IS WHERE I NEED TEST
...
End If
End Sub
------------------------
My problem arises because it's possible to expand and collapse the
tree without clicking on a node (or, more specifically, using the +/-
symbols does not trigger the NodeClick event).
BTW, if anyone can recommend a good tutorial on using treeview
controls in Access, I'd really appreciate it. I've found a couple,
but they seem to focus mostly on populating the control from code;
I've found nothing really helpful about subsequent manipulation, or
useful events, or ...
TIA,
Rob