Solved

Treeview in Vb6

Posted on 2011-03-24
5
577 Views
Last Modified: 2012-06-27
hi
  firstletter = mid(txtfields.text),1,1)
  tvtreeview.nodes(firstletter).children

but i am getting an error. What I need to know is how do I use a varibale and get the number of the children depending on what the first letter of the text box is.
  tvtreeview.nodes("A".children works fine. but I need to use my firstletter varible.
thanks very much for time and assistance
Urgent
0
Comment
Question by:CBB
  • 3
5 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 total points
ID: 35207066
what about this:

firstletter = left(txtfields.text,1)
tvtreeview.nodes(firstletter).children

Open in new window

apart from that, if you still get an error, it's because there is no such treeview node with that "letter" as key

0
 

Assisted Solution

by:benny_ca
benny_ca earned 100 total points
ID: 35207092
just try

  tvtreeview.nodes(cstr(mid(txtfields.text),1,1))).children
0
 

Accepted Solution

by:
CBB earned 0 total points
ID: 35207347
hi angelll and benny

thanks both were correct and my was correct too the problem was what angell told me
that got me thinking. My tree had only capitals letter and my textbox was giving lower cases.
So I had to ucase(firstletter) then it worked

thanks so much for all your help. I will split it since I appreciate all your time and assistance
0
 

Author Comment

by:CBB
ID: 35207368
experts exchange is a wonderful site
0
 

Author Closing Comment

by:CBB
ID: 35239058
They gave me an idea that I realize that was not using capitals letters.

thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA: Select SQL query based on a config Sheet v2 11 49
VB6 ListBox Question 4 50
Export Data to Different .csv Files 26 115
VBA: loop recent folder and copy txt file. 8 36
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 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