SkipVought
Programmer
Suppose I have a query like this...
But I want to accomplish it with separate recordsets...
In reality, rst2 is a summary of rst1, and several other queries as well.
My objective is that after I post the resultset for rst2, I give the user the ability to drill down into rst1 and other detail resultsets that are summarized in rst2.
Skip,
When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen!
Code:
Select
A.F1
, Sum(B.F1)
From Table1 A
,
(
Select
F1
, F2
From Table2
) B
Where A.F2=B.F2
Group By A.F1
Code:
sSQL = "Select "
sSQL = sSQL & " F1 "
sSQL = sSQL & ", F2 "
sSQL = sSQL & "From Table2 "
rst1.Open sSQL, cnn, adOpenForwardOnly
sSQL = "Select "
sSQL = sSQL & " A.F1
sSQL = sSQL & ", Sum(B.F1)
sSQL = sSQL & "From Table1 A
sSQL = sSQL & ",
sSQL = sSQL & "([b]
'somehow use rst1 here. I know I can use it like [highlight]rst1.Source[/highlight], but is there another method?[/b]
sSQL = sSQL & ") B
sSQL = sSQL & "Where A.F2=B.F2
sSQL = sSQL & "Group By A.F1
rst2.Open sSQL, cnn, adOpenDynamic
My objective is that after I post the resultset for rst2, I give the user the ability to drill down into rst1 and other detail resultsets that are summarized in rst2.
Skip,
When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen!