Vba / access incrémentation
Destinos
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour,
voila j'aimerai incrémenter une variable lors d'une erreur/doublon (3022) en vba;
je bosse sur ce code actuellement mais l'incrementation ne s'opère pas correctement:
Function Insertion(oRst1 As DAO.Recordset, orst2 As DAO.Recordset) As Integer
On Error GoTo err
Dim nb As Integer
Dim Fld As DAO.Field
nb = 0
orst2.AddNew
For Each Fld In oRst1.Fields
If (Fld.Attributes And dbAutoIncrField) = 0 Then
orst2.Fields(Fld.Name).Value = Fld.Value
End If
Next Fld
orst2.Update
err:
Select Case err.Number
Case 3022
nb = nb + 1
Insertion = nb
End Select
End Function
merci de m'aider
voila j'aimerai incrémenter une variable lors d'une erreur/doublon (3022) en vba;
je bosse sur ce code actuellement mais l'incrementation ne s'opère pas correctement:
Function Insertion(oRst1 As DAO.Recordset, orst2 As DAO.Recordset) As Integer
On Error GoTo err
Dim nb As Integer
Dim Fld As DAO.Field
nb = 0
orst2.AddNew
For Each Fld In oRst1.Fields
If (Fld.Attributes And dbAutoIncrField) = 0 Then
orst2.Fields(Fld.Name).Value = Fld.Value
End If
Next Fld
orst2.Update
err:
Select Case err.Number
Case 3022
nb = nb + 1
Insertion = nb
End Select
End Function
merci de m'aider
A voir également:
- Vba / access incrémentation
- Acer quick access - Forum logiciel systeme
- Quick Access service ✓ - Forum PC portable
- Désinstaller ACER QUICK ACCESS - Forum Logiciels
- Access appdata - Guide
- Excel compter cellule couleur sans vba - Guide