Bonjour,

J'ai ajouté deux compteurs dans un état : un compteur au niveau de l'entête(commande) ,l'autre au niveau du détail (produit).

Un problème subsiste : au changement de page, le compteur compt_CNT s'incrémente de 2.

Ex:
P 0 Produit
P 1 Produit
P 2 Produit
P 3 Produit
P 4 Produit
P 5 Produit
P 6 Produit
------------------------------------------------------Nouvelle page

P 8 Produit
P 9 Produit



Voici le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
' 
' Les compteurs partiront de la valeur 0.
Private compt_Cmde        As Long ' VariaCmdee de comptage des Commandes
Private compt_Prd       As Long ' VariaCmdee de comptage des produits pour un commande
 
 
Private Sub Détail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo sortie_erreur
 
    IDE_num_Prd = compt_Prd
 
    compt_Prd = compt_Prd + 1
 
sortie:
    Exit Sub
sortie_erreur:
    MsgBox "Detail_Format : " & Err.Description
    Resume sortie
End Sub
 
Private Sub EntêteGroupe0_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo sortie_erreur
 
 
    compt_Cmde = 0
    compt_Prd = 0
 
sortie:
    Exit Sub
sortie_erreur:
    MsgBox "EntêteGroupe0_Format : " & Err.Description
    Resume sortie
End Sub
 
Private Sub EntêteGroupe1_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo sortie_erreur
 
    IDE_numCmde = compt_Cmd
    compt_Cmde = compt_Cmde + 1
    compt_Prd = 0
 
sortie:
    Exit Sub
sortie_erreur:
    MsgBox "EntêteGroupe1_Format : " & Err.Description
    Resume sortie
End Sub
Pouvez-vous m'aider à résoudre ce problème

Par avance Merci