Every 5th record...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm slow today... How do you cycle through a record set and use a variable to
keep track of every 5th record? Actually, I know how to cycle through a rec
set, but I need to do something in code every 5th record. I know it's not
hard, but...

I hope this makes sense.

Thanks in advance,
Clint Herman
 
Dim LngCount as Long

' Start of LOOP
LngCount = LngCount +1
If LngCount Mod 5 = 0 Then
' DoSomething
End If

' Do other stuff in the loop

'End of Loop
 
Figured it out. FYI

I used the mod operator. What I wanted to do was update a week field in my
table so that 1st 7 days (basically every 7 records) is week 1, then the next
7 days is week 2, etc.

If (RCS.AbsolutePosition + 1) Mod 7 = 0 Then
B = B + 1
End If

Clint
 
Back
Top