There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
adware audio bios blue screen boot bsod card computer crash dell driver drivers error excel firefox freeze google hard drive hardware hijackthis install internet laptop linux malware network no sound outlook problem reboot recovery redirect router screen server slow sound speakers spyware startup trojan usb video virus vista windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
VB6 TreeView

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
cseewald's Avatar
Junior Member with 1 posts.
 
Join Date: Jul 2009
Experience: Intermediate
01-Jul-2009, 06:13 AM #1
Question VB6 TreeView
Hi all

I am writing a payroll application that uses entities and attributes to describe Companies, Jobs and Employees. The rules are as follows:

1) Companies are at the highest level
2) Jobs link to companies
3) Employees link to jobs

The issue is that 1 or many jobs can belong to 1 or many companies and 1 or many employees can belong to 1 or many jobs. This is enforced in the EntityLinks table (See attached diag).

I need to create a treeview that shows the heirarchy as follows:

Company 1
-----> Job 1
----------> Employee 1

-----> Job 2
----------> Employee 1
----------> Employee 2
Company 2
-----> Job 2
----------> Employee 1
----------> Employee 3
----------> Employee 4

-----> Job 3

----------> Employee 2
----------> Employee 6
----------> Employee 9

I have been pulling my hair out over this for the last 4 days and have written lots of code from examples on the internet.

Problem: Because Parent and Child Entities can appear multiple times in the entity links table, i am struggling with a unique Key at each level of the treeview. Bearing in mind that i need the entityID(EID) and the EntityAttributeDescription(EntAttText) for each entity.

tvEntAttRel.Nodes.Add(, , "a" & Trim$(rs.Fields("EID")), Trim(rs.Fields("EntAttText")), 1, 1)

The only unique value for the links is the EntityLinksID(ELINKID), that would make the key unique, but there is no place in the above line of code to put it

ideally, it would be:

tvEntAttRel.Nodes.Add(, , "a" & Trim$(rs.Fields("ELINKID")), Trim$(rs.Fields("EID")), Trim(rs.Fields("EntAttText")), 1, 1)

WHERE:

ELINKID is the uniqueID for entity link (job to comp, or emp to job etc)
EID is the uniqueID for the entities in the link
EntAttText is the description of the entity ie Job1,Company 1

Please let me know if this post is not clearly understandable

Please Help

Thanks

Chris
Attached Thumbnails
VB6 TreeView-dbpic_comp.jpg  
Closed Thread Bookmark and Share

Tags
tree, treenode, treeview

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:58 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.