?
Solved

Treeview in Vb6

Posted on 2011-03-24
5
Medium Priority
?
591 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 1600 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 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