acc2003: recordcount property or sql count question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JMCN

    acc2003: recordcount property or sql count question

    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.OpenRecords et("")
    with rsttemp
    do until rstTemp.eof
    rsttemp![field1].recordcount
    rsttemp.movenex t
    loop
    end with

    thanks in advance and any help would be appreciated!! jung
  • Bruno Campanini

    #2
    Re: acc2003: recordcount property or sql count question

    "JMCN" <picarama@yahoo .fr> wrote in message
    news:2772ee20.0 410271148.3ea1c 437@posting.goo gle.com...[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.OpenRecords et("")
    > with rsttemp
    > do until rstTemp.eof
    > rsttemp![field1].recordcount
    > rsttemp.movenex t
    > 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.RecordC ount then
    rstTem.MoveLast
    NumRecs = rstTemp.RecordC ount
    Else
    NumRecs = 0
    End If

    Ciao
    Bruno


    Comment

    Working...