I am trying to create a form so that I can display a high level down to a low level in one column (ALL of Sam's reports, direct and indirect) without having to use code...I am hoping table structure alone will allow this flexibility...does anyone know of any existing examples I could peruse to help???
26 20754
Looks to me you need a self-related table like:
ID
IDofParent
FieldX
Now you can place this table e.g. 4 times and connect from the first the IDofParent to the ID of the second, the IDofParent of the second to the ID of the third, etc.
This does require a max of levels, but is doable without code.
The general approach would however bee to use a tree control, but that required advanced VBA skills....
Nic;o)
I am trying to create a form so that I can display a high level down to a low level in one column (ALL of Sam's reports, direct and indirect) without having to use code...I am hoping table structure alone will allow this flexibility...does anyone know of any existing examples I could peruse to help???
A TreeView Control would, as Nico stated, graphically display this Hierarchal Structure on a Form and we could also keep its syntax as simple as possible. Give me a sample subset of the data with all Levels defined and I'll post the code for you. Once you see it, I'm sure that you will be able to fill in the blanks.
- Level 1 Level 2 Level 3 Level 4
-
OPS SOAR Provider Service Provider Services
-
OPS SOAR Provider Service ALL Reviews
-
OPS SOAR Service Quality QA
-
OPS DOES Document Operations NA
-
OPS DOES Process Reengineering NA
-
OPS DOES Electronic Solutions ES Support
-
OPS DOES Electronic Solutions ES Maintenance
-
Finance Monroe ASO ASO Customer Service
-
Finance Monroe ASO ASO Claims
-
Finance Monroe ASO ASO Rewards
-
Finance Monroe PCG Customer Guarantees
so if i choose a manager from the last row, i should see all individuals for all 3 lower levels in a single row, i.e.:
Monroe + PCG + Customer Gurtantees
if I need to add further info let me know - without code this is a headache inducer...
- Level 1 Level 2 Level 3 Level 4
-
OPS SOAR Provider Service Provider Services
-
OPS SOAR Provider Service ALL Reviews
-
OPS SOAR Service Quality QA
-
OPS DOES Document Operations NA
-
OPS DOES Process Reengineering NA
-
OPS DOES Electronic Solutions ES Support
-
OPS DOES Electronic Solutions ES Maintenance
-
Finance Monroe ASO ASO Customer Service
-
Finance Monroe ASO ASO Claims
-
Finance Monroe ASO ASO Rewards
-
Finance Monroe PCG Customer Guarantees
so if i choose a manager from the last row, i should see all individuals for all 3 lower levels in a single row, i.e.:
Monroe + PCG + Customer Gurtantees
if I need to add further info let me know - without code this is a headache inducer...
I will get back to you on this shortly.
I will get back to you on this shortly.
Hang on to your seat belts and follow these instructions exactly:
__01 Create a New, Unbound Form.
__02 Place a TreeView Control on the Form via Insert ==> ActiveX Control ==> Microsoft TreeView Control.
__03 Size the Control to the full Form dimensions.
__04 Rename the TreeView Control to TreeView1. If it is named anything other than this, the code will not be functional.
__05 Place the following code in the Form's Load() Event (listed below).
__06 When the Form opens, you will see the Root and Level1 Nodes. You can now see your Hierarchal structure by Expanding/Collapsing (+/-) various branches to move Up and Down multiple Levels as in Windows Explorer.
__07 Each Level in the code has its own degree of indentation to make your understanding of the coding process easier so that you may adapt the code to your own specific needs.
__08 If you have any questions, feel free ask as the TreeView Control is a fairly complex Control to implement.
__09 If you are interested, you can also display Icons for each individual Node but this involves inserting an ImageList Control, assigning Icons to it, pointing the TreeView Control to it, and setting Index values for each Icon for each line of code. - Private Sub Form_Load()
-
Dim nodX As Node
-
-
'1-Relative, tvwChild-Relationship, "g"-Key, "George"-Text
-
Set nodX = TreeView1.Nodes.Add(, , , "Hierarchal Structure Example (ROOT)") 'Root of Treeview Control
-
-
Set nodX = TreeView1.Nodes.Add(1, tvwChild, "Topic1", "OPS")
-
Set nodX = TreeView1.Nodes.Add("Topic1", tvwChild, "Level2A", "SOAR")
-
Set nodX = TreeView1.Nodes.Add("Level2A", tvwChild, "Level3A", "Provider Service")
-
Set nodX = TreeView1.Nodes.Add("Level3A", tvwChild, "Level4A", "Provider Services")
-
Set nodX = TreeView1.Nodes.Add("Level3A", tvwChild, "Level4B", "ALL Reviews")
-
Set nodX = TreeView1.Nodes.Add("Level2A", tvwChild, "Level3B", "Service Quality")
-
Set nodX = TreeView1.Nodes.Add("Level3B", tvwChild, "Level4C", "QA")
-
Set nodX = TreeView1.Nodes.Add("Topic1", tvwChild, "Level2B", "DOES")
-
Set nodX = TreeView1.Nodes.Add("Level2B", tvwChild, "Level3C", "Document Operations")
-
Set nodX = TreeView1.Nodes.Add("Level3C", tvwChild, "Level4D", "NA")
-
Set nodX = TreeView1.Nodes.Add("Level2B", tvwChild, "Level3D", "Process Engineering")
-
Set nodX = TreeView1.Nodes.Add("Level3D", tvwChild, "Level4E", "NA")
-
Set nodX = TreeView1.Nodes.Add("Level2B", tvwChild, "Level3E", "Electronic Solutions")
-
Set nodX = TreeView1.Nodes.Add("Level3E", tvwChild, "Level4F", "ES Support")
-
Set nodX = TreeView1.Nodes.Add("Level3E", tvwChild, "Level4G", "ES Maintenance")
-
Set nodX = TreeView1.Nodes.Add(1, tvwChild, "Topic2", "Finance")
-
Set nodX = TreeView1.Nodes.Add("Topic2", tvwChild, "Level2C", "Monroe")
-
Set nodX = TreeView1.Nodes.Add("Level2C", tvwChild, "Level3F", "ASO")
-
Set nodX = TreeView1.Nodes.Add("Level3F", tvwChild, "Level4H", "ASO Customer Service")
-
Set nodX = TreeView1.Nodes.Add("Level3F", tvwChild, "Level4I", "ASO Claims")
-
Set nodX = TreeView1.Nodes.Add("Level3F", tvwChild, "Level4J", "ASO Rewards")
-
Set nodX = TreeView1.Nodes.Add("Level2C", tvwChild, "Level3G", "PCG")
-
Set nodX = TreeView1.Nodes.Add("Level3G", tvwChild, "Level4K", "Customer Guarantees")
-
-
nodX.EnsureVisible
-
-
TreeView1.Nodes(1).ForeColor = QBColor(4)
-
-
Exit_Form_Load:
-
Exit Sub
-
-
Err_Form_Load:
-
MsgBox Err.Description, vbExclamation, "Error in TreeView_Form_Load()"
-
Resume Exit_Form_Load
-
End Sub
WOW - I knew it wouldn’t' be easy - I follow you to a point - in your instructions I don't see anything tying the code to my table – or am I just putting the layout and table data directly in the code itself as you have done with the few examples I provided?
WOW - I knew it wouldn’t' be easy - I follow you to a point - in your instructions I don't see anything tying the code to my table – or am I just putting the layout and table data directly in the code itself as you have done with the few examples I provided?
This is simlpy hard-coded values to give you an idea of how this Control functions. Reading values from a Table/Recordset wopuold add complexity to the coding.
Thanks - this code worked perfect!!!
Thanks - this code worked perfect!!!
Glad to help you.
hey guys, glad to see the code working, but i can't really find where is the activex control in vba. Please advise.
Thanks
hey guys, glad to see the code working, but i can't really find where is the activex control in vba. Please advise.
Thanks
- Form Design View.
- Insert.
- ActiveX Control.
- You are now in the Insert ActiveX Control Dialog Box.
- Select the Microsoft TreeView Control, version X.X.
- The TreeView Control should now exist in the Upper Left Hand corner of the Form.
Thanks so much. it took me a while. :D There is one more thing that i dont know if the treeview can do. For ex, if im gonna select Service Quality ( Under OPS-SOAR), will it be possible to make a button that will copy the hierachy into the following format: OPS/ SOAR/ Service Quality?
Thanks so much man. you are the man
Thanks so much. it took me a while. :D There is one more thing that i dont know if the treeview can do. For ex, if im gonna select Service Quality ( Under OPS-SOAR), will it be possible to make a button that will copy the hierachy into the following format: OPS/ SOAR/ Service Quality?
Thanks so much man. you are the man
Yes, it should be no problem. They wouold simply be Children of Parent Nodes, follow the examples.
Thank you, i probably didn't make myself clear enough. It is a lil bit confusing for me.
I have successfully constructed the tree, but the information that is useful for the end user if they can extract the information out of the tree and use it.
Using the treview that we have here as an example, if I want to select service quality (which is under OPS and SOAR), is there a way to extract the levels i have go through in a text string that can look something like this:
OPS/ SOAR/ Service Quality
On the same line, if I want to convert to text string just SOAR ( under OPS), it will give me OPS/SOAR ?
and hopefully the same thing will happen if i click something else in the treeview.
I dont know if this can be accomplished by using buttons and text boxes or using something else.
Please help. I really Appreciate it. you are the man
Thank you, i probably didn't make myself clear enough. It is a lil bit confusing for me.
I have successfully constructed the tree, but the information that is useful for the end user if they can extract the information out of the tree and use it.
Using the treview that we have here as an example, if I want to select service quality (which is under OPS and SOAR), is there a way to extract the levels i have go through in a text string that can look something like this:
OPS/ SOAR/ Service Quality
On the same line, if I want to convert to text string just SOAR ( under OPS), it will give me OPS/SOAR ?
and hopefully the same thing will happen if i click something else in the treeview.
I dont know if this can be accomplished by using buttons and text boxes or using something else.
Please help. I really Appreciate it. you are the man
You could extract all Children of Main Node and concatenate the result as in: Main Node/Child 1/Child 2/Child 3/...etc.
Is this what you are looking for? If it is you can Reference the Help Files for the Child and Parent properties. If you still have difficulties, let me know.
I hope you can see the tree that i just made.
One that tree, i created a submit button (it can't do anything yet), but i would love if it can extract from my selection.
In this ex, i select professional by going through legal- professional, when i click submit button, it should return the string "legal/ professional" like in the example http://www.flickr.com/photos/31626245@N06/2959564798/
similarly, for automobile, if i click automobile and then submit, it will return the string " automobile" in the box. http://www.flickr.com/photos/31626245@N06/2959569056/
Is there any ways to accomplish this?
Thanks
I hope you can see the tree that i just made.
One that tree, i created a submit button (it can't do anything yet), but i would love if it can extract from my selection.
In this ex, i select professional by going through legal- professional, when i click submit button, it should return the string "legal/ professional" like in the example http://www.flickr.com/photos/31626245@N06/2959564798/
similarly, for automobile, if i click automobile and then submit, it will return the string " automobile" in the box. http://www.flickr.com/photos/31626245@N06/2959569056/
Is there any ways to accomplish this?
Thanks
It'as probably a lit simpler than you realize, the the NodeClick() Event of the treeView Control, place the following code for a visual cue: - Private Sub TReeview1_NodeClick(ByVal Node As Object)
-
MsgBox Replace(Node.FullPath, "\", "/")
-
End Sub
It'as probably a lit simpler than you realize, the the NodeClick() Event of the treeView Control, place the following code for a visual cue: - Private Sub TReeview1_NodeClick(ByVal Node As Object)
-
MsgBox Replace(Node.FullPath, "\", "/")
-
End Sub
Wow thats only a 3 line of codes. lol Thanks man, but i have a compiler error saying that " procedure declaration does not match description of event or procedure having the same name".. that sucks.
So I went ahead trying to find solutions for this compiler error, but nothing is really showing up.
Crap, so I created a label so i can show this, using the following code
Label1.Caption = nodX.FullPath
(nodX is the variable)
Well, it shows, but it only shows the last one, and it did not show anything else when i click through nodes. Is there any updates can be done, or even an If function might be helpful.
Thanks
Wow thats only a 3 line of codes. lol Thanks man, but i have a compiler error saying that " procedure declaration does not match description of event or procedure having the same name".. that sucks.
So I went ahead trying to find solutions for this compiler error, but nothing is really showing up.
Crap, so I created a label so i can show this, using the following code
Label1.Caption = nodX.FullPath
(nodX is the variable)
Well, it shows, but it only shows the last one, and it did not show anything else when i click through nodes. Is there any updates can be done, or even an If function might be helpful.
Thanks
The correct syntax in the NodeClick() Event is: - Me![Label1].Caption = Node.FullPath
The correct syntax in the NodeClick() Event is: - Me![Label1].Caption = Node.FullPath
So should i use the IF loop for this? I tries to implement the code in various lines, but the label only shows the node that is above this code.
Is there anyways to show the appropriate path when choosing any specific node?
Thanks
So should i use the IF loop for this? I tries to implement the code in various lines, but the label only shows the node that is above this code.
Is there anyways to show the appropriate path when choosing any specific node?
Thanks
Yes, by using either an If...ElseIf...Else...End If, or Select Case Structure. It all depends on which Nodes you want to exclude.
Yes, by using either an If...ElseIf...Else...End If, or Select Case Structure. It all depends on which Nodes you want to exclude.
ADezii,
I want to inlcude every node. But only when i select them, it will show the full path. Please advice on how to use if properly for this treeview.
Thanks
ADezii,
I want to inlcude every node. But only when i select them, it will show the full path. Please advice on how to use if properly for this treeview.
Thanks
The code as it is now, placed in the NodeClick() Event will activate 'only' when the Node is Clicked/Selected. I don't know what else to tell you.
The code as it is now, placed in the NodeClick() Event will activate 'only' when the Node is Clicked/Selected. I don't know what else to tell you.
Thanks, ADezii,
I found the solution for this. This following code works:
Private Sub Tree_NodeClick(ByVal Node As MSComctlLib.Node)
Me.Label1.Caption = Node.FullPath
End Sub
I have no Idea why we have to use the MSComctLib.Node, but it shows the path perfectly.
Thanks so much for helping me with this VBA. I really appreciate it.
Thanks, ADezii,
I found the solution for this. This following code works:
Private Sub Tree_NodeClick(ByVal Node As MSComctlLib.Node)
Me.Label1.Caption = Node.FullPath
End Sub
I have no Idea why we have to use the MSComctLib.Node, but it shows the path perfectly.
Thanks so much for helping me with this VBA. I really appreciate it.
ADezii,
Its maybe really easy, but I just can't seem to find a way to record that path I show into the textbox and then add another fullpath into the same textbox. Any advice?
ADezii,
Its maybe really easy, but I just can't seem to find a way to record that path I show into the textbox and then add another fullpath into the same textbox. Any advice?
I'm assuming that you mean to add another Full Path to the Label Control which already contains a Full Path, if so: - Me.Label1.Caption = Me.Label1.Caption & "\" & Node.FullPath
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim |
last post by:
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:
I have two forms (say Form1 and Form2). Form 1 contains a TreeView control.
A...
|
by: SoKool |
last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control.
I intend to use a treeview to generate a...
|
by: Srinivasa Raghavan |
last post by:
Hi All,
I have some doubts on the Treeview control and Form
Authentication
1) will Form Authentication work if cookies are disabled.
2) I have problem in the following code (TreeView...
|
by: Chris |
last post by:
Hi,
anyone experience with the TreeView control that is available in the
Microsoft.Web.UI.WebControls component ?
I want to add a few nodes to the TreeView-control but don't know quite how :...
|
by: Peter |
last post by:
Hello,
We are inserting a side menu to our application using a class that is
writing HTML on all our pages. This is a part of the code as an
example:
writer.Write(" <table WIDTH=""100%""...
|
by: Ben Coats |
last post by:
Hey,
I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
|
by: p3t3r |
last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS
styles for the root level nodes. The topmost root node should not have a top
border, all the other root nodes should have a...
|
by: david |
last post by:
I do not know if there is a treeView control for web form in .NET 1.1.
I know there is IE Webcontrol package which has the treeview control for
..net 1.0. I have tested it in .net 1.1 before. It...
|
by: noneya22 |
last post by:
I want to use a TreeView control as a one-level, vertical navigation
menu. I'm using this control currently with a SiteMapDataSource
and .sitemap file. I've written code that associates an image...
|
by: echuck66 |
last post by:
Hi,
I have a Winforms 2.0 project that I'm working on that involves populating a treeview control from data contained in a fairly large dataset that has to be refreshed periodically.
I have no...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |