Thanks for your help up until this point Michael, but if you don't want to help me any further, you don't have to (aka you can choose not to reply).
Of course I had looked into TreeView before replying. My question was more like, "I thought this control worked for displaying data." I have read up on TreeView and all I can find is how to pass data to this control and display data in a form using this control. I'm using Access 2003 and cannot find any info about it in Help.
I originally asked for online resources dealing with representing hierarchical data in Access. I would like to write queries/code to take my data from a flat table to hierarchical so that I can run queries on the hierarchical form.
In Access VBA, you can setup a class module (super class). At the module level of super class module, you can setup pointers that point to other "sub" class modules which fill with the desired data. Repeat the process to get to as many levels as you like. It might sounds complicated, but is quite easily accomplished.
Once you have your data in the momory domain, you can manipulate them until your heart's contend.
Repersentation <> develpoment (of hierarchical data). Your (original request) requested help with the representation. TreeView is a good canidate fot the representation. I assume that b y representation you mean (or meant) VISUAL representation. not logical representation. Forms / Reports are appropiate to the Visual representation. Queries are (perhaps) appropiate to the logical representation. Sorry for being quite so cryptic, thought (and still think) my response was 'in-line' with your request.
I may have a parent/child table that looks like this:
ID NAME CHILD
1 Arnold 4
1 Arnold 5
2 Karen 3
3 Rick NULL
4 Tommy 6
5 Nicole NULL
6 Sam NULL
The resulting tree would look like:
+ Arnold
+ Tommy
- Sam
- Nicole
+Karen
- Rick
In another table, I have the dollar amount that each has contributed to a fund:
ID AMOUNT
1 $10
2 $25
3 $5
4 $20
5 $30
6 $5
I would like to perform queries on this data. One thing that I may want to know is how much a particular subset of the family has contributed.
EX. How much has Arnold's family (all those under him) contributed? (i.e. Arnold + Tommy + Sam + Nicole = $65)
How much has Tommy's family contributed? (i.e. Tommy + Sam = $25)
I assume the data volume is not too large - maybe a few thousand records. If so, the OLEDB MSDATASHAPE provider will represent data in a hierarchial recordset. By using this provider you could represent the data you show in a hierarchy in an ADO recordset. Once the recordset was built, then the Filter method of ADO can be used to query the recordset.
Rob MacDonald in the book, Serious ADO, has a chapter on setting up hierarchial recordsets.
And ... of course ... you are willing to contribute the necessary "resources (Read $$$) to facillitate this? Noting that there may also be training needs for however many?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.