Re: How to summarize recordset...Select Distinct alternative?




"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:Ot8dKQmJIHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
Bob Barrows [MVP] wrote:

darn, can't figure out the filter looping method

this works perfect for the first file and first page...but how to get the
next page, and next, and next ... to the end of first file,
..... then next file (all pages)...next file(all pages).. etc to end of all
files....?

With oRsPcmkCountAll
.MoveFirst
bFirstFile = True'just print file name once
bFirstPage = True'just print page name once
'get first filename
ThisDwgName = .Fields.Item("fldDwgName").Value
'get first pagename
ThisLayoutName = .Fields.Item("fldLayoutName").Value

'---------------------- filter section
'apply first filter
oRsPcmkCountAll.Filter = "fldDwgName='" & ThisDwgName & "' and
fldLayoutName='" & ThisLayoutName & "'"
'---------------------- how and where do I put successive filters
for each page/each file?

While Not .EOF
If bFirstFile Then
bFirstFile = False
logEntry "Pcmks in file" & ThisDwgName
End If
If bFirstPage Then
bFirstPage = False
logEntry vbTab & "Layout " & ThisLayoutName
End If
logEntry vbTab & vbTab & "Pcmk " &
oRsPcmkCountAll.Fields.Item("fldPcmk") & " (" &
oRsPcmkCountAll.Fields.Item("PcmkCount") & ")"
.MoveNext

Wend

'ok now i need the next page of the first file but it seems i'd have to hard
code another loop...one for each page and one for each file...which is
obviously not right....


'''this would filter for next layout for first file...but somehow it has to
be inside the .eof loop...but where???
oRsPcmkCountAll.Filter = "fldDwgName='" & ThisDwgName & "' and
fldLayoutName<>'" & ThisLayoutName & "'"
While Not .EOF
...another loop? no I don't think so
Wend



End With

my poor old brains just not getting it
:-)

Mark


.