<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347549#M78486</link>
    <description>Bobby&lt;BR /&gt;
&lt;BR /&gt;
If you are adding nodes with something like&lt;BR /&gt;
&lt;BR /&gt;
Set nodEntry = TreeView1.Nodes.Add(sColor, tvwChild, sCompLoc, sComponent, "Thaw")&lt;BR /&gt;
&lt;BR /&gt;
then you can simply add after it&lt;BR /&gt;
nodEntry.Sorted = True&lt;BR /&gt;
&lt;BR /&gt;
Works for me&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent Keller&lt;BR /&gt;
http://kwikmcad.topcities.com/&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BOBBYJ&gt; wrote in message&lt;BR /&gt;
news:9E59BB8A82EB372394AA5E1C996000E5@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Thanks Sean, Unfortunately my data is not stored in a database...I have sort&lt;BR /&gt;
&amp;gt; functions and I can pre-sort my data before populating the control, but it&lt;BR /&gt;
&amp;gt; appeared that I could have the control sort for me...&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Happy Holidays...&lt;BR /&gt;
&amp;gt; Bobby C. Jones&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BOBBYJ&gt;</description>
    <pubDate>Wed, 26 Dec 2001 10:14:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-12-26T10:14:47Z</dc:date>
    <item>
      <title>TreeView Sorting</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347546#M78483</link>
      <description>I've created a TreeView control on a form.  I've got the code to populate it&lt;BR /&gt;
in the form's Initialize event.  After the control is populated I set it's&lt;BR /&gt;
Sorted property to True...it doesn't sort &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;  What overly documented&lt;BR /&gt;
crucial piece of info am I missing?&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
VBA in A2ki on Win2k&lt;BR /&gt;
--&lt;BR /&gt;
Happy Holidays...&lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com</description>
      <pubDate>Wed, 26 Dec 2001 08:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347546#M78483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-12-26T08:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: TreeView Sorting</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347547#M78484</link>
      <description>Hi Bobby:&lt;BR /&gt;
I use a treeview that gets values from ADO database objects. I use the SORT&lt;BR /&gt;
method before i populate the treeview...&lt;BR /&gt;
&lt;BR /&gt;
    Dim rstRecords As New ADODB.Recordset&lt;BR /&gt;
    rstRecords .CursorLocation = adUseClient&lt;BR /&gt;
    rstRecords .Open "qryAccessQuery", cnn, adLockReadOnly&lt;BR /&gt;
    rstRecords .Sort = Name&lt;BR /&gt;
&lt;BR /&gt;
This sorts the treeview on a column called 'Name'.  It may not be perfect&lt;BR /&gt;
but it works for me. good luck.&lt;BR /&gt;
Sean&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BOBBYJ&gt; wrote in message&lt;BR /&gt;
news:E393F51CB41B2A9002791D3A8A61DFCD@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I've created a TreeView control on a form.  I've got the code to populate&lt;BR /&gt;
it&lt;BR /&gt;
&amp;gt; in the form's Initialize event.  After the control is populated I set it's&lt;BR /&gt;
&amp;gt; Sorted property to True...it doesn't sort &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;  What overly documented&lt;BR /&gt;
&amp;gt; crucial piece of info am I missing?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; TIA&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; VBA in A2ki on Win2k&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Happy Holidays...&lt;BR /&gt;
&amp;gt; Bobby C. Jones&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BOBBYJ&gt;</description>
      <pubDate>Wed, 26 Dec 2001 09:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347547#M78484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-12-26T09:26:48Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347548#M78485</link>
      <description>Thanks Sean, Unfortunately my data is not stored in a database...I have sort&lt;BR /&gt;
functions and I can pre-sort my data before populating the control, but it&lt;BR /&gt;
appeared that I could have the control sort for me...&lt;BR /&gt;
--&lt;BR /&gt;
Happy Holidays...&lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com</description>
      <pubDate>Wed, 26 Dec 2001 09:34:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347548#M78485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-12-26T09:34:38Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347549#M78486</link>
      <description>Bobby&lt;BR /&gt;
&lt;BR /&gt;
If you are adding nodes with something like&lt;BR /&gt;
&lt;BR /&gt;
Set nodEntry = TreeView1.Nodes.Add(sColor, tvwChild, sCompLoc, sComponent, "Thaw")&lt;BR /&gt;
&lt;BR /&gt;
then you can simply add after it&lt;BR /&gt;
nodEntry.Sorted = True&lt;BR /&gt;
&lt;BR /&gt;
Works for me&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent Keller&lt;BR /&gt;
http://kwikmcad.topcities.com/&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BOBBYJ&gt; wrote in message&lt;BR /&gt;
news:9E59BB8A82EB372394AA5E1C996000E5@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Thanks Sean, Unfortunately my data is not stored in a database...I have sort&lt;BR /&gt;
&amp;gt; functions and I can pre-sort my data before populating the control, but it&lt;BR /&gt;
&amp;gt; appeared that I could have the control sort for me...&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Happy Holidays...&lt;BR /&gt;
&amp;gt; Bobby C. Jones&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BOBBYJ&gt;</description>
      <pubDate>Wed, 26 Dec 2001 10:14:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347549#M78486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-12-26T10:14:47Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347550#M78487</link>
      <description>That's the winner!  Thanks Kent.&lt;BR /&gt;
--&lt;BR /&gt;
Happy Holidays...&lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com</description>
      <pubDate>Mon, 31 Dec 2001 11:23:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/treeview-sorting/m-p/347550#M78487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-12-31T11:23:37Z</dc:date>
    </item>
  </channel>
</rss>

