G
Guest
Hi~~
I have a main form with a sub form.
The following Do while loop only updates 2 rows, however, there are still 10
more records in the sub form.
Please look at this code. Thanks in advance... ^^
Do While rsTest.EOF = False
iTestFrequency = rsTest.Fields.Item("TestFrequencyNum")
'Find Limit
Do While rsLimit.EOF = False
If rsLimit.Fields.Item("Category") =
Val(Forms![frmTDS].Category.Value) _
And rsLimit.Fields.Item("LimitFrequencyFrom") <=
iTestFrequency _
And rsLimit.Fields.Item("LimitFrequencyTo") >=
iTestFrequency Then
With rsTest
rsTest.Fields.Item("Limit") = rsLimit.Fields.Item("Limit")
.Update
End With
Exit Do
Else
rsLimit.MoveNext
End If
Loop
rsTest.MoveNext
'Exit Do
Loop
I have a main form with a sub form.
The following Do while loop only updates 2 rows, however, there are still 10
more records in the sub form.
Please look at this code. Thanks in advance... ^^
Do While rsTest.EOF = False
iTestFrequency = rsTest.Fields.Item("TestFrequencyNum")
'Find Limit
Do While rsLimit.EOF = False
If rsLimit.Fields.Item("Category") =
Val(Forms![frmTDS].Category.Value) _
And rsLimit.Fields.Item("LimitFrequencyFrom") <=
iTestFrequency _
And rsLimit.Fields.Item("LimitFrequencyTo") >=
iTestFrequency Then
With rsTest
rsTest.Fields.Item("Limit") = rsLimit.Fields.Item("Limit")
.Update
End With
Exit Do
Else
rsLimit.MoveNext
End If
Loop
rsTest.MoveNext
'Exit Do
Loop