He probado el codigo de estas 3 formas y me ha enviado error
1.
Código vb:
Ver originalPrivate Sub Eliminar_Click()
Dim sql$, x As Long, y As Long
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
sql$ = "Select CodClientes From Clientes Order By CodClientes"
With rst
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sql$, CurrentProject.Connection, , , adCmdText
End With
x = rst.RecordCount
rst.MoveFirst
For y = 1 To x
rst.CodClientes = y
rst.Update
rst.MoveNext
Next y
Set rst = Nothing
End Sub
2.
Código vb:
Ver originalPrivate Sub Eliminar_Click()
Dim sql$, x As Long, y As Long
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
sql$ = "Select CodClientes From Clientes Order By CodClientes"
With rst
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sql$, CurrentProject.Connection, , , adCmdText
End With
x = rst.RecordCount
rst.MoveFirst
For y = 1 To x
rst!CodClientes = y
rst.Update
rst.MoveNext
Next y
Set rst = Nothing
End Sub
3.
Código vb:
Ver originalPrivate Sub Eliminar_Click()
Dim sql$, x As Long, y As Long
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
sql$ = "Select CodClientes From Clientes Order By CodClientes"
With rst
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sql$, CurrentProject.Connection, , , adCmdText
End With
x = rst.RecordCount
rst.MoveFirst
For y = 1 To x
rst.Fields! CodClientes = y
rst.Update
rst.MoveNext
Next y
Set rst = Nothing
End Sub