hcts,
Hm. Interesting idea. A tree view is probably not possible, but creating something that lets the user drill down to the selected record should be.
I don't (yet) have an article on my site that shows how to do this, but here's what occurs to me as I type.
Assuming your journal table contains the general and detail field values and you have a secondary index containing those values, you could:
1) Run a query to return all available general values and save that to something like

riv:genvalues.
2) Run a second query to return all available general and detail values, saving it to

riv:detvalues.
3) Create an index on detvalues that contains the general and detail.
4) Open a form with a data model along these lines:
Code:
:priv:genvalues
+-----> :priv:detvalues
+-----> :data:journal
This way, the user will select general values, Paradox will show matching details. The user selects one of these and then sees the related record in the main journal table.
With this in mind, consider the following code:
Code:
var
q Query
tc tCursor
fm Form
t Table
endVar
Message( "Collecting general values..." )
q = Query
:data:journal | General |
| Check |
endQuery
if not q.executeQBE( tc ) then
errorShow( "Can't Run Query", "Click >> for details" )
return
else
tc.instantiateView( ":priv:genvalues" )
endIf
Message( "Collecting detail values..." )
q = Query
:data:journal | General | Detail |
| Check | Check |
endQuery
if not q.executeQBE( tc ) then
errorShow( "Can't Run Query", "Click >> for details" )
return
else
tc.instantiateView( ":priv:detvalues" )
endIf
; For best results, always formally close tCursors
if tc.isAssigned() then
tc.close()
endIf
Message( "Organizing results..." )
t.attach( ":priv:detvalues" )
t.setExclusive( Yes )
index t
primary
on 1, 2
endIndex
t.unattach()
; open the form
fm.open( ":forms:gdbrowse" )
Message( "Done!" )
This is off the top of my head, so treat it as proof of concept, rather than perfectly working, but it should get you pointed in the right direction.
Hope this helps...
-- Lance