[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1266
  • Last Modified:

Treeview NodeClick just quit working in Access Form

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!
1 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now