tree view

Posted on 2001-06-21
Last Modified: 2010-05-02
i have an access database with three tables
vehicle (vehicle no , type , etc.)
Test (Test ID, vehicle no , smoke reading, smoke result ,test date, etc.)
Brake (Test ID , Axle no, Reading, result, etc.)

1 vehicle has many tests
1 test has many brake tests

first of all will come the vehicle details above of the form
then i want to put all other information in a tree view

Test Date (1/1/1999)
-------smoke reading
-------smoke result
-------Axle no -- for example this is axle one
-------Axle no -- the same will be done for other axles

and the above diagram will be repeated for each test date

Test Date (2/2/1999)
-------smoke reading
-------smoke result
-------Axle no -- for example this is axle one
-------Axle no -- the same will be done for other axles

Is this possible, if yes, how can i do it
Question by:Brave_Heart
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
LVL 52

Expert Comment

by:Ryan Chong
ID: 6217253
Hi, is it the element "Smoke" & "Brake" come from same table?

In database, you can use the SQL "Group By" group test's date to show the results.

Author Comment

ID: 6217346
but how can i do the tree view ... i never used it at alll  and how can i connect it to database fields
LVL 52

Expert Comment

by:Ryan Chong
ID: 6217389
Hi, to add items in a listview:

For i = 1 To adodc1.recordset.recordcount
    LVWS.ListItems.Add i, , "" & adodc1.recordset.fields![abc]
    LVWS.ListItems(i).SubItems(1) = "" & adodc1.recordset.fields![xyz]
Next i

Useful Links:

Can you post the Table design?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

cmgarnett earned 200 total points
ID: 6217428
Certainly not complete and tested code but it may set you off in the right direction.

rs1 = vehicle file by vehicle ID
while not rs1.eof
  Set nodX = tvw1.Nodes.Add(, , rs1!vehicleid, rs1!vehicleid)
  nodX.Expanded = True
  rs2 = test file by test date and test id where vehicle id = rs1!vehicle id
  while not rs2.eof
    Set nodX = tvw1.Nodes.Add(rs1!vehicleid, tvwChild, rs2!testdate, rs2!testdate)
    nodX.Expanded = True
    rs3 = brake file by test id and axle no
    while not rs3.eof
      Set nodX = tvw1.Nodes.Add(rs2!Testdate, tvwChild, rs3!axleid, rs3!axleid)
      nodX.Expanded = true
LVL 49

Expert Comment

ID: 7139677
Hi Brave_Heart,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept cmgarnett's comment(s) as an answer.

Brave_Heart, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7174006
Comment from expert accepted as expert

E-E Moderator

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 43
using web browser with BING 40 148
IF ELSE Statement in Excel Macro VBA 16 98
Set WorkSheet  not Working 9 62
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

732 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