Private Sub tvHelpTree_NodeClick(ByVal nodTreeView As Object)
Dim RecordtoSelect As Long
Dim strTopic As String
Dim strDiscription As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Me.txtSelectedKey = nodTreeView.Key
Select Case Left(nodTreeView.Key, 1)
Case "x"
Exit Sub
Case "A"
Set rst = db.OpenRecordset("usysHelpLevel1", dbOpenDynaset)
RecordtoSelect = Right(nodTreeView.Key, 1)
rst.FindFirst "Level1ID = " & RecordtoSelect
Me!txtTopic = rst!Topic1
Me.rtfHelp = Nz(rst!Discription1, "")
rst.Close
Exit Sub
Case "B"
Set rst = db.OpenRecordset("usysHelpLevel2", dbOpenDynaset)
RecordtoSelect = Right(nodTreeView.Key, 1)
If Len(nodTreeView.Key) < 3 Then
strTopic = Nz(DLookup("Topic2", "usysHelpLevel2", "[Level2ID] = " & Right(nodTreeView.Key, 1)), "")
Me!txtTopic = strTopic
strDiscription = Nz(DLookup("Discription2", "usysHelpLevel2", "[Level2ID] = " & Right(nodTreeView.Key, 1)), "")
Me.rtfHelp = Nz(strDiscription, "")
Me!txtKeyCode = Right(nodTreeView.Key, 1)
Else
strTopic = Nz(DLookup("Topic2", "usysHelpLevel2", "[Level2ID] = " & Right(nodTreeView.Key, 2)), "")
Me!txtTopic = strTopic
strDiscription = Nz(DLookup("Discription2", "usysHelpLevel2", "[Level2ID] = " & Right(nodTreeView.Key, 2)), "")
Me.rtfHelp = Nz(strDiscription, "")
Me!txtKeyCode = Right(nodTreeView.Key, 2)
End If
rst.Close
Exit Sub
End Select
End Sub