Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

erreur dans un loop

1 réponse
Avatar
FTH
Bonjour,

Je calle lamentablement et sans savoir pourquoi.
En applicant le bout de code ci-dessous, j'ai l'erreur suivante:
" Rutime error'3426'
"This action was cancelled by an associated object"
Ah bon?
ça calle soit sur Movenext ou sur movefirst..
merci pour vos lumières,

Frédéric


Private Sub BtRefresh_Click()
Dim rst As Recordset
Set rst = Me.Recordset


With rst
If Not .BOF Then
.MoveFirst
Do Until .EOF
If IsNull(Me.ContratType) Then
Me.ContratType = "rien"
End If

'.MoveNext
Loop
End If
End With

' retour au premier enregistrement
With rst
.MoveFirst
End With
'rst.Close: Set rst = Nothing
Me.Refresh
Set rst = Nothing
End Sub

1 réponse

Avatar
3stone
Salut,

"FTH"
| Je calle lamentablement et sans savoir pourquoi.
| En applicant le bout de code ci-dessous, j'ai l'erreur suivante:
| " Rutime error'3426'
| "This action was cancelled by an associated object"
| Ah bon?
| ça calle soit sur Movenext ou sur movefirst..
| merci pour vos lumières,
|
| Frédéric


Private Sub BtRefresh_Click()
Dim rst As Recordset
Set rst = Me.Recordset


With rst
If Not .BOF Then
.MoveFirst
Do Until .EOF
If IsNull(!ContratType) Then
!ContratType = "rien"
End If

.MoveNext
Loop
End If
End With

' retour au premier enregistrement
With rst
.MoveFirst
End With
rst.Close: Set rst = Nothing
Me.Refresh
Set rst = Nothing
End Sub

---
même s'il reste des choses inutiles... ca devrait le faire, maintenant.

;-)

--
A+
Pierre (3stone) Access MVP
Perso: http://www.3stone.be/
MPFA: http://www.mpfa.info/ (infos générales)