Treeview NodeClick just quit working in Access Form

Posted on 2012-08-23
Last Modified: 2012-08-23
I haven't run into a situation like this before. Basically my tree view on node click just quit working. The odd thing is I use this tree view application if you will in a standalone access db as well as another db. Both have there own sets of code (although they are identical). I just noticed yesterday that neither tree updates the subforms anymore.

The subforms get updated through textboxes on the main form that get populated with the corresponding data from a TreeView0_NodeClick sub. I put a stop in on that sub to see if it was even firing anymore and it wasn't.

So how can I get this sub to start firing again?  Here is the code for that sub;

Public Sub TreeView0_NodeClick(ByVal Node As Object)

Dim nodSelected As MSComctlLib.Node
Set tvw = Me.TreeView0.Object
Set nodSelected = Me.TreeView0.SelectedItem
Dim frm As Access.Form
Dim strNodeText As String
Dim strTitlePlus As String
Dim myKey() As String
Set nd = Node
tvw.DropHighlight = Nothing
tvw.DropHighlight = nd
nd.Selected = True

Set frm = Me![sfrmTreeOperations].Form
Set frm1 = Me![sfrmTreeMaterials].Form

    If nodSelected.Key Like "Opr*" Then
        frm.Visible = True
        frm1.Visible = False
        myKey() = Split(Node.Key, ",")
        Me.txtMtlSeq = "0"
        Me.txtAssemblySeq = Val(Mid(myKey(1), 3))
        Me.txtOprSeq = Val(Mid(myKey(2), 3))
        Me.txtTranType = myKey(3)
        If nodSelected.Key Like "Mtl*" Then
            frm.Visible = False
            frm1.Visible = True
            myKey() = Split(Node.Key, ",")
            Me.txtOprSeq = "0"
            Me.txtAssemblySeq = Val(Mid(myKey(1), 3))
            Me.txtMtlSeq = Val(Mid(myKey(2), 3))
            Me.txtTranType = myKey(3)
        End If
    End If

End Sub

Open in new window

Thanks for the input!
Question by:SeyerIT
    1 Comment
    LVL 39

    Accepted Solution

    Have you tried to compile code? One of Microsoft updates changes mscomctl.ocx and it not working now without a lot of efforts. Check version of mscomctl.ocx. Possible solution is here:
    Here is same case:

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now