| re: acc2003: recordcount property or sql count question
"JMCN" <picarama@yahoo.fr> wrote in message
news:2772ee20.0410271148.3ea1c437@posting.google.c om...[color=blue]
> hello-
>
> i have created a tabular form using records from a specific query.
> then users will filter out the specific data. the next step is to take
> the count of the current records (daily open items), then use the
> total number of daily open items to calculate the percentage to all
> open items for the month.
>
> my first question is how would i be able to capture the current
> filtered openrecordset and count the records? would i use the
> .recordcount or SQL count? the records will vary each month.
>
> Set dbs = CurrentDb
> Set RstTemp = dbs.OpenRecordset("")
> with rsttemp
> do until rstTemp.eof
> rsttemp![field1].recordcount
> rsttemp.movenext
> loop
> end with
>
> thanks in advance and any help would be appreciated!! jung[/color]
I don't understand your code from row "with rsttemp".
To count the records in your recordset:
If rstTemp.RecordCount then
rstTem.MoveLast
NumRecs = rstTemp.RecordCount
Else
NumRecs = 0
End If
Ciao
Bruno |