Multiple Nodes Keystroke Usage

Posted on 2011-05-09
Last Modified: 2012-05-11
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.

Question by:dminx13
    LVL 119

    Expert Comment

    by:Rey Obrero
    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

    Author Comment

    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.

    Author Comment

    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.

    Author Comment


    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.......

    Author Comment

    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

    Author Comment

    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.

    Accepted Solution

    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.

    Author Closing Comment

    Figured out my own solution.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    728 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

    24 Experts available now in Live!

    Get 1:1 Help Now