mfaqueiroz
Registered User.
- Local time
- Today, 11:02
- Joined
- Sep 30, 2015
- Messages
- 125
Hei 
I'm doing a code that compares two tables(AF1,AF2) with 2 for cycles. I want that when first for cycle ends the next for cycle begins at AF2 stopped.
So, I recorded the ID2 and I've write( as are in red) AF1.Move ID2
but isn't working, it moves for a row very far away of what i pretend...any sugestion?
End = DCount("[ID]", "H1")
AF1.MoveFirst
For x = 1 To End
Day1 = DateValue(AF1.Fields(2).Value)
ID1 = AF1.Fields(0).Value
AF2.MoveFirst
For y = 1 To End
ID2 = AF2.Fields(0).Value
If Day1=Day2 Then
AF2.Edit
AF2.Fields(13).Value = "I"
AF2.Update
Flag = 1
If Flag = 1 Then
y = FimA
End If
End If
End If
AF2.MoveNext
Next y
AF1.MoveFirst
AF1.Move ID2
Next x
End Sub
I'm doing a code that compares two tables(AF1,AF2) with 2 for cycles. I want that when first for cycle ends the next for cycle begins at AF2 stopped.
So, I recorded the ID2 and I've write( as are in red) AF1.Move ID2
but isn't working, it moves for a row very far away of what i pretend...any sugestion?
End = DCount("[ID]", "H1")
AF1.MoveFirst
For x = 1 To End
Day1 = DateValue(AF1.Fields(2).Value)
ID1 = AF1.Fields(0).Value
AF2.MoveFirst
For y = 1 To End
ID2 = AF2.Fields(0).Value
If Day1=Day2 Then
AF2.Edit
AF2.Fields(13).Value = "I"
AF2.Update
Flag = 1
If Flag = 1 Then
y = FimA
End If
End If
End If
AF2.MoveNext
Next y
AF1.MoveFirst
AF1.Move ID2
Next x
End Sub