Solved

Treeview in Vb6

Posted on 2011-03-24
5
583 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

707 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