Multiple Nodes Keystroke Usage

I have multiple tree structures in my database on forms. All of them seem to working appropriately except for one. Basically you have the main node and then nodes underneath the main. You can use keystrokes to get to the different nodes + and - to open and close the nodes, the arrow keys to go up and down. This is working perfectly for a all forms except for one and I have no idea where to begin troubleshooting why it is not working. Any suggestion on where to start and go from there? I've tried doing a comparison between one that works and one that doesn't and still am not really finding the problem.

Who is Participating?
dminx13Connect With a Mentor Author Commented:
OK, well after 3 hours of testing I finally figured it out. It seems that after posting on here I often find the answer.

Someone in the coding had set the focus to be on a specific flexgrid. I finally figured out which one by deleting the flexgrids individaully. Once it was gone the tree worked so I commented out the set focus and now it works perfectly.
Rey Obrero (Capricorn1)Commented:
it will help if you can upload a copy of the db.
or create a blank db and import all the objects relevant to this question.

upload the created db
dminx13Author Commented:
Oh, another thing I thought of that might be helpful. It works the very first time. So I can open the form type in a "r" and it will take me to the r section. After that inital keystroke it stops working. I can also do a down arrow or a + on the first node and it works, but again after that initial keystroke nothing will work.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

dminx13Author Commented:
I know uploading would be helpful but this isn't a small database nor is it something that I know how everything links together just yet. I am working on it, but it isn't that simple to do.
dminx13Author Commented:

At this point there is no way for me to post a DB. The frm links to a system table that is pointing to a different database. I have tried to pick up just the tables that it needs but that isn't allowing the form to run either. I could post the code for the frm but that is about all I am going to be able to do at this point.......
dminx13Author Commented:
This is what fill the tree:

    '  Procedure is used to fill the position tree
    Dim objTree As TreeView
    Dim objImage As ImageList
    Dim nodDepartment As Node
    Dim nodPosition As Node
    Dim sKey As String
    Dim sName As String
    Dim sDept As String
    Set objTree = Me.treePositions.Object
    Set objImage = Me.imgListIcons.Object
    objTree.ImageList = objImage
    With Positions
        sDept = "noDepartment"
        If .EOF And .BOF Then
            '  no records to report
                If .Fields("Department") <> sDept Then
                    '  we are on a new department and we need to add
                    '  a node for the department
                    sDept = .Fields("Department")
                    sKey = "D" + sDept
                    sName = .Fields("Name") + " - " + Right(.Fields("Department"), 5)
                    Set nodDepartment = objTree.nodes.Add(, , sKey, sName)
                End If
                '  Add the position nodes for each department
                sKey = "P" + .Fields("Department") + .Fields("JCC")
                sName = .Fields("Position") + " - " + Right(.Fields("JCC"), 4)
                If .Fields("Provisional") = True Then
                    '  Light On Icon to highlight a provisional position
                    Set nodPosition = objTree.nodes.Add(nodDepartment, tvwChild, sKey, sName, 2)
                ElseIf .Fields("Status") = "A" Then
                    '  No Icon
                    Set nodPosition = objTree.nodes.Add(nodDepartment, tvwChild, sKey, sName)
                    '  Red X for inactive positions
                    Set nodPosition = objTree.nodes.Add(nodDepartment, tvwChild, sKey, sName, 1)
                End If
            Loop Until .EOF
        End If
    End With
    '4/12/2011 trying to get tree to work properly
    'With objTree
    '   For i = 1 To .nodes.Count
    '      .nodes(i).EnsureVisible
    ' Next i
    'End With
    'Set rs = Nothing
    'For i = 0 To 3
    '    Set nod(i) = Nothing
    'Next i
    ' Set objTree = Nothing

End Sub
dminx13Author Commented:
Could it have anything to do with multiple flex grids? I was looking at the ones that work and they only have one flex grid where this one has multiple.
dminx13Author Commented:
Figured out my own solution.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.