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
 
Thanks for your reply! I guess our posts hit the system at the same time. (:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top