To count missin records! 
Author Message
 To count missin records!

I need to show in a form, how long time a number don't apear at a table
(begining at the last record).  It's hard to me to explain, so see my
example:

tblRecords:
RegID number (autonumber)
data    date
var1    number (from 1 to 5)
var2    number (from 1 to 5)
var3    number (from 1 to 5)

tblRecords exemple:
RegID        Data   var1  Var2  Var3
    001  03/10/98     01      02      03
    002  04/10/98     01      03      04
    003  05/10/98     01      03      04

Results exemple:

possible
values for
var1, var2
var3
            01  0  (it's present at the last record)
            02  2  (don't show at 2 records)
            03  0  (it's present at the last record)
            04  0  (it's present at the last record)
            05  Never  (never show)

Any help will be welcome.

Thanks

--
Claudio Ramos
Rio de Janeiro, RJ Brasil



Fri, 27 Apr 2001 03:00:00 GMT  
 To count missin records!
Function LastRecord(MyVal)
dim rs as recordset
dim i as integer
set rs=currentdb.openrecordset("MyTable",dbOpenDynaset)
rs.movelast
i=0
do
        if rs!var1=MyVal or rs!var2=MyVal or rs!var3=MyVal then
                LastRecord=i
                exit function
        endif
        rs.moveprevious
        i=i+1
loop until rs.bof
LastRecord=null

end function

That's the bulk of it.  I don't think this will examine the  first record,
but I'll let you work on that part of it.

HTH
        - Turtle



Quote:
> I need to show in a form, how long time a number don't apear at a table
> (begining at the last record).  It's hard to me to explain, so see my
> example:

> tblRecords:
> RegID number (autonumber)
> data    date
> var1    number (from 1 to 5)
> var2    number (from 1 to 5)
> var3    number (from 1 to 5)

> tblRecords exemple:
> RegID        Data   var1  Var2  Var3
>     001  03/10/98     01      02      03
>     002  04/10/98     01      03      04
>     003  05/10/98     01      03      04

> Results exemple:

> possible
> values for
> var1, var2
> var3
>             01  0  (it's present at the last record)
>             02  2  (don't show at 2 records)
>             03  0  (it's present at the last record)
>             04  0  (it's present at the last record)
>             05  Never  (never show)

> Any help will be welcome.

> Thanks

> --
> Claudio Ramos
> Rio de Janeiro, RJ Brasil



Fri, 27 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Eliminate records of one table based on another table record count

2. Counting records in a record set

3. Record Count in a Record Set

4. Query record count

5. Record Count in VB?

6. Count Zero records as 0

7. dcount or counting records code?

8. counting records

9. Counting records returned by SQL Select statement

10. Wrong record count in code

11. How to count the records added to a table

12. depleting record counts

 

 
Powered by phpBB® Forum Software