
changes to all records in one rec set based on position in another rec set
I have the following code for two tables.
Public Function StartFirst()
Dim rstTeamPoints As Recordset
Dim rstIndivPts As Recordset
Dim dbs As Database
Dim intI As Integer
Set dbs = CurrentDb()
Set rstTeamPoints = dbs.OpenRecordset("qryTeamTotal")
Set rstIndivPts = dbs.OpenRecordset("qryRace1StartOrder")
intI = 1
Do While Not rstTeamPoints.EOF
rstIndivPts.MoveFirst
Do While Not rstIndivPts.EOF
'If rstTeamPoints.EOF Then rstTeamPoints.MoveFirst
'If [rstIndivPts]![StartOrder] Then
If [rstIndivPts]![Team] = [rstTeamPoints]![TeamName]
Then
rstIndivPts.Edit
[rstIndivPts]![StartOrder] = intI
rstIndivPts.Update
intI = intI + 1
rstTeamPoints.MoveNext
rstIndivPts.MoveFirst
Else: rstIndivPts.MoveNext
End If
Loop
rstTeamPoints.MoveNext
Loop
End Function
**********************************************
rstTeamPoints has 6 records. they are in the order of team finish. I
have to go through the rstIndivPts and assign a starting position. This
table has 335 records now but will change with time. My code stops after
the first time through as it runs out of records in rstTeamPoints(6) How
can i keep it going to assign a starting number field to all 335
records.. The starting times in order go by fastest team matches to the
fastest racer from that team
2nd fastest team 2nd fastest racer ... 1st fastest team 7th fastest
racer... 2nd fastest team 8th fastestest racer and through people who we
did
not in participatein the last event with no position.