cont = 1
INICIO:
If cont = rs.RecordCount Then
GoTo Final
Else
nombre = rs.Fields(0): fchavta = rs.Fields(3): rs.MoveNext
If nombre = rs.Fields(0) Then
If rs.Fields(3) > fchavta Then
rs.MovePrevious: rs.Delete: rs.MoveNext: GoTo INICIO
Else
rs.Delete: rs.MoveNext: GoTo INICIO
End If
Else
cont = cont + 1: GoTo INICIO
End If
End If
Final:
dgLento.ClearFields
Set dgLento.DataSource = rs
FormatoDataGrid
dim temp as long, bucle as long
temp = rs.recordcount
rs.movefirts
for bucle = 1 to temp-1
rs.delete
rs.update
rs.movenext
next bucle