air1access
Technical User
I have a recordset I'm tryin' to update via a Loop...
The base tbl has duplicate values in one field called IID. The varying tbl has the IID only once...
Linked by IID between both recordsets - the code I'm working with runs thru & updates only the 1st IID in the base tbl, and then it moves to the next IID, updates the 1st IID & so on... Instead of updating the rest of the IIDs that are equal. I need for the code to loop thru the IIDs that are equal updating other fields values, and then move to the next IID in the recordset, etc..
I sure hope this makes sense...!! Any suqqestions or examples..?? Below is what I'm working with thus far...
Thanks in advance..
air1access
Do While Not rstVarying.EOF
rstBase.FindFirst "[IID] = '" & rstVarying!IID & "'"
If Not rstBase.NoMatch Then
rstBase.Edit
rstBase!PrimeMPN = rstVarying!PrimeMPN
rstBase!Description = rstVarying!Description
rstBase!Class = rstVarying!Class
rstBase!FleetType = rstVarying!FleetType
rstBase.Update
End If
rstVarying.MoveNext
Loop
The base tbl has duplicate values in one field called IID. The varying tbl has the IID only once...
Linked by IID between both recordsets - the code I'm working with runs thru & updates only the 1st IID in the base tbl, and then it moves to the next IID, updates the 1st IID & so on... Instead of updating the rest of the IIDs that are equal. I need for the code to loop thru the IIDs that are equal updating other fields values, and then move to the next IID in the recordset, etc..
I sure hope this makes sense...!! Any suqqestions or examples..?? Below is what I'm working with thus far...
Thanks in advance..
air1access
Do While Not rstVarying.EOF
rstBase.FindFirst "[IID] = '" & rstVarying!IID & "'"
If Not rstBase.NoMatch Then
rstBase.Edit
rstBase!PrimeMPN = rstVarying!PrimeMPN
rstBase!Description = rstVarying!Description
rstBase!Class = rstVarying!Class
rstBase!FleetType = rstVarying!FleetType
rstBase.Update
End If
rstVarying.MoveNext
Loop