There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
VB6 TreeView

Reply  
Thread Tools
cseewald's Avatar
Junior Member with 1 posts.
 
Join Date: Jul 2009
Experience: Intermediate
01-Jul-2009, 07: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  
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:32 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.