IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB 6 et antérieur Discussion :

Impression d'une série de bulletins de paie


Sujet :

VB 6 et antérieur

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut Impression d'une série de bulletins de paie
    Bonjour
    C'est ma première question dans ce forum.
    Je travaille sur une petite application en VB6, et Access comme BD, je suis arrivé au stade d'impression ( avec le DataReport)
    J'ai réussi le code pour imprimer les bulletins individuellement. C'est-à-dire, par personne sélectionnée.
    Mon problème est que je n'arrive pas à réussir à imprimer d'un seul clic sur la commande tous les bulletins de la période.A ce niveau je suis trouvé dans l'impasse.
    Je vous demande de l'aide.

  2. #2
    Modérateur
    Avatar de l_autodidacte
    Homme Profil pro
    Retraité : Directeur de lycée/Professeur de sciences physiques
    Inscrit en
    Juillet 2009
    Messages
    2 415
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Retraité : Directeur de lycée/Professeur de sciences physiques
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2009
    Messages : 2 415
    Points : 5 805
    Points
    5 805
    Par défaut
    Bonjours et BIENVENU sur DVP

    Envoyé par MSDN :
    Le premier exemple affiche la boîte de dialogue Imprimer qui permet à l'utilisateur de spécifier le nom du fichier et la plage de pages. Le second exemple imprime l'état sans afficher la boîte de dialogue.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Private Sub DisplayPrintDialog()
       DataReport1.PrintReport True
    End Sub
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    Private Sub PrintWithoutDialog()
       ' Imprime toutes les pages de l'état.
       DataReport1.PrintReport False, rptRangeAllPages
    End Sub
    Lors de l'exécution, cette méthode imprime l'état créé avec le concepteur Data Report.
    Syntaxe
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    object.PrintReport(ShowDialog, Range, PageFrom, PageTo)
    La syntaxe de la méthode PrintReport comprend les éléments suivants :
    Élément Description
    object Expression d'objet qui correspond à la valeur d'un objet figurant dans la rubrique "Application".
    ShowDialog Facultatif.Expression booléenne qui détermine si la boîte de dialogue Imprimer est affichée.
    Range Facultatif. Définit un entier qui détermine si toutes les pages de l'état seront exécutées, ou uniquement une plage de pages, comme indiqué dans la section Valeurs.
    PageFrom Facultatif. Entier qui définit la première page de l'impression.
    PageTo Facultatif. Entier qui définit la dernière page de l'impression.
    Valeurs
    Constante Value Description
    rptRangeAllPages 0 (Valeur par défaut) Toutes les pages seront imprimées.
    rptRangeFromTo 1 Seules les pages de la plage spécifiée seront imprimées.
    Au fait, quel est le code utilisé pour l'impression ?
    Ne pas oublier le tag si satisfait.
    Voter pour toute réponse satisfaisante avec pour encourager les intervenants.
    Balises CODE indispensables. Regardez ICI
    Toujours utiliser la clause Option Explicit(VBx, VBS ou VBA) et Ne jamais typer variables et/ou fonctions en VBS.
    Vous pouvez consulter mes contributions
    Ne pas oublier de consulter les différentes FAQs et les Cours/Tutoriels VB6/VBScript
    Ne pas oublier L'Aide VBScript et MSDN VB6 Fr

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut L'impression de serie de bulletins de paie
    Bonjour
    Je vous remercie pour votre réponse, une fois essayée je vous tiendtai au courant du resultat

    Mon code utilisé pour l'impression individuelle est

    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
    Sub cmdImpression_Click()
     
    On error resume next
     
    AdBulletin.ConnectionString="Provider=Microsoft.jet ...."
     
    Sqls= "select * from TableQuinzaines where ( Dossier='" & ( VarDossier) & "')"
     
    AdBulletin.RecordSource=Sqls
    Set DRBulletin.DataSource=adBulletin
     
    DRBulletin.Section("Section4").Controls("LblNom").Caption=VarNom
    ......
    .....
    ......
     
    DRBulletin.show
    DRBulletin.WindowState=2
     
    End sub
    Pour l'impression de toute la série existante, j'ai fais le même code à l'intérieur de la boucle For next.
    Pour déterminer les valeurs de chaque lignes de la TableQuinzaines.

    En fin de la boucle j'ai mets la condition une fois la valeur de I est égale au nombre de lignes Exit FOR

    Avec ce code seule les données de la dernière ligne qui s'affiche sur le DRBulletin. Là mon problème

    Merci une autre fois pour votre réponse

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut Impression d'une serie de bulletins de paie
    Rebonjour

    J'ai essayé votre code pour imprimer tous les bulletins, mais l'application m'imprime seulement la premiere personne de la file

    J'ai essayé aussi le code suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    if I < NOrdreBulletinF then
    DRBulletin.PrintReport
    Goto Autre:
    Exit sub
    Elseif I=NOrdreBulletin then
    DRBulletin.PrintReport
    Exit for
    End if
     
    Autre:
     
    Next I
    Aussi l'application imprime toujours la première personne de la file.
    Quand je vérifie les valeurs de I renvoyées par la boucle, je les trouve exactes.
    Je ne sais pas comment faire.

    Merci pour votre aide

  5. #5
    Modérateur
    Avatar de l_autodidacte
    Homme Profil pro
    Retraité : Directeur de lycée/Professeur de sciences physiques
    Inscrit en
    Juillet 2009
    Messages
    2 415
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Retraité : Directeur de lycée/Professeur de sciences physiques
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2009
    Messages : 2 415
    Points : 5 805
    Points
    5 805
    Par défaut
    L'utilisation de l'instruction On Error Resume Next est vivement déconseillée car elle risque de masquer des erreurs qu'il faut gérer par le code. Par exemple,on utilise plutôt : On Error GoTo Line avec Line l'emplacement de la gestion d'erreurs.

    La structure de la Sub d'impression me semble incorrecte. Essaie de nous la mettre en totalité.
    Une instruction Exit For interrompt l'exécution de la Sub; même chose pour Exit Sub
    Ne pas oublier le tag si satisfait.
    Voter pour toute réponse satisfaisante avec pour encourager les intervenants.
    Balises CODE indispensables. Regardez ICI
    Toujours utiliser la clause Option Explicit(VBx, VBS ou VBA) et Ne jamais typer variables et/ou fonctions en VBS.
    Vous pouvez consulter mes contributions
    Ne pas oublier de consulter les différentes FAQs et les Cours/Tutoriels VB6/VBScript
    Ne pas oublier L'Aide VBScript et MSDN VB6 Fr

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut Impression d'une série de bulletins de paie
    Rebonjour
    Suite à nos échanges, je vous remets la structure de la Sub Impression, certes, il y a beaucoup de lignes, mais c'était nécessaire pour deux raisons
    Je suis novice dans le domaine
    le DataReport ne me laissait pas le choix

    ma structure est comme suit :
    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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    Private Sub CdImpression_Click()
    If CmbPeriode = "" Then
    MsgBox "Désolé, vous devez sélectionner une quinzaine", vbCritical + vbInformation, "Info "
    CmbPeriode.SetFocus
    Exit Sub
    End If
     
     
    'Déterminer le nombre des bulletins à imprimer
    SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            NbreBulletins = RS.RecordCount
            RS.Close
     
           SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "')  and (Periode='" & CStr(CmbPeriode) & "'))" & "order by NOrdre asc"
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![Periode] = CmbPeriode Then
            RS.MoveFirst
            NOrdreBulletinD = RS![NOrdre]
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "')  and (Periode='" & CStr(CmbPeriode) & "'))" & "order by NOrdre asc"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![Periode] = CmbPeriode Then
            RS.MoveLast
            NOrdreBulletinF = RS![NOrdre]
     
            End If
            RS.Close
     
            J = NOrdreBulletinD
     
    For I = J To NOrdreBulletinF Step 1
            SQLs = "select * from TableQuinzaines where ( (Dossier='" & CStr(VarDossier) & "') and (NOrdre=" & CInt(NOrdreBulletinD) & "))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NOrdre] = NOrdreBulletinD Then
            VarNomBulletin = RS![NomComplet]
     
            End If
            RS.Close
     
     
            SQLs = "select * from TableInfos where ((Societe='" & CStr(VarSociete) & "')and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
     
            If RS![NomComplet] = VarNomBulletin Then
            VarMatriculeB = RS![Matricule]
            VarDateEntreeB = RS![DateDebut]
            VarDateNaissanceB = RS![DateNaissance]
            VarCinB = RS![CIN]
            VarCnssB = RS![Cnss]
            VarAdresseOB = RS![Adresse]
            VarSFB = RS![Statut]
            VarNbreEnfantB = RS![NEnfant]
            End If
            RS.Close
     
            If VarSFB = "VEUF(VE)" Then
            VarSFB = "V"
            ElseIf VarSFB = "DIVORCE(E)" Then
            VarSFB = "D"
            ElseIf VarSFB = "CELIBATAIRE" Then
            VarStatutB = "C"
            ElseIf VarSFB = "MARIE(E)" Then
            VarSFB = "M"
            End If
    '______________________________
     
     
            SQLs = "select * from TableAttributions where ((Societe='" & CStr(VarSociete) & "')and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarNbreDeductionB = RS![NbreDeduction]
            VarServiceB = RS![Service]
            VarPosteB = RS![Poste]
            VarModePaiementB = RS![ModePaiement]
            VarSalBaseB = RS![SalaireBase]
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" &                               CStr(CmbPeriode) & "'))" & "order by NOrdre asc"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarTauxAncB = RS![TauxAnciennete]
            End If
            RS.Close
     
            VarTauxAncB = Format(VarTauxAncB, "#,##0.00")
    '_____________________________________
     
     
    'Détermination des valeurs
     
     
            Dim VPxHs, VPcHs, NbreHN, MtChargeF, MaxChargeF As Double
     
     
            SQLs = "select * from TableFraisProfessionnels where (Societe='" & CStr(VarSociete) & "')"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![Societe] = VarSociete Then
            VPxHs = RS![PxHS]
            VPcHs = RS![PcHS]
            NbreHN = RS![HJr]
            MtChargeF = RS![ChargeF]
            MaxChargeF = RS![Max]
            End If
            RS.Close
    '________________________________________________________________________________
     
     
    'calcul du salaire de base (Prix unitaire H)
     
     
            Dim VHSB, VHS1B, PxHFB, PxHRB, PxHTB As Double
     
            'Heures Sup
            If ((VPxHs <> 0) And (VPcHs = 0)) Then
            VHSB = THS * VPxHs
            ElseIf ((VPxHs = 0) And (VPcHs <> 0)) Then
            VHS1B = VarSalBaseB / NbreHN
            VHS1B = VHS1B * (1 + VPcHs)
            End If
     
            PxHFB = VarSalBaseB / NbreHN
            PxHRB = VarSalBaseB / NbreHN
            PxHTB = VarSalBaseB / NbreHN
    '___________________________________________________________________________________________
     
     
            'Déterminer le nombre des bulletins à traiter
     
           'Heures normales
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" &                                   CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarHNB = Format(RS![Hn], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & 
            CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarGainHNB = Format(RS![ValHN], "#,##0.00")
            End If
            RS.Close
              'Heures supplémentaires
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & 
            CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarHSB = Format(RS![Hs], "#,##0.00")
            End If
            RS.Close
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & 
             CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarGainSB = Format(RS![ValHS], "#,##0.00")
            End If
            RS.Close
     
          'Heures fériées
           SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & 
            CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
            VarHFB = Format(RS![HF], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarGainFB = Format(RS![ValHF], "#,##0.00")
            End If
            RS.Close
     
     
    'Heures Récupération
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarHRB = Format(RS![Hr], "#,##0.00")
            End If
            RS.Close
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarGainRB = Format(RS![ValHR], "#,##0.00")
            End If
            RS.Close
     
     
    'Heures à la tache
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarHTB = Format(RS![HT], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarGainTB = Format(RS![ValHT], "#,##0.00")
            End If
            RS.Close
     
     
    '____Calcul Somme sal brut
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (Periode='" & CStr(CmbPeriode) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarTotalB = Format(RS![SalBrut], "#,##0.00")
            End If
            RS.Close
     
            Dim GainTotal, TestGainT As Double
     
     
            GainTotal = CDbl(VarGainHNB)
            GainTotal = CDbl(GainTotal) + CDbl(VarGainSB)
            GainTotal = CDbl(GainTotal) + CDbl(VarGainFB)
            GainTotal = CDbl(GainTotal) + CDbl(VarGainRB)
            GainTotal = CDbl(GainTotal) + CDbl(VarGainTB)
     
            VarMtAncB = Format((CDbl(VarTotalB) - CDbl(GainTotal)), "#,##0.00")
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarSalNetB = Format(RS![SalNet], "#,##0.00")
            End If
            RS.Close
     
     
    'Les arrondis
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarArrondisB = Format(RS![Arrondis], "#,##0.00")
            End If
            RS.Close
     
     
    '-----Les Cotisations
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotCnssPsB = Format(RS![CotCnss], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotAmoPsB = Format(RS![CotAmo], "#,##0.00")
            End If
            RS.Close
     
            Dim VarCotB As Double
            VarCotB = Format((CDbl(VarCotCnssPsB) + CDbl(VarCotAmoPsB)), "#,##0.00")
     
     
      'Parts patronales
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotCnssPpB = Format(RS![CotCnssPP], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotAmoPpB = Format(RS![CotAmoPP], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotAFPpB = Format(RS![CotAFPP], "#,##0.00")
            End If
            RS.Close
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarCotTFPPpB = Format(RS![CotTFPPP], "#,##0.00")
            End If
            RS.Close
     
     
          Dim VarTotalCotPp As Double
          VarTotalCotPp = Format((CDbl(VarCotCnssPpB) + CDbl(VarCotAmoPpB) + CDbl(VarCotAFPpB) + CDbl(VarCotTFPPpB)), "#,##0.00")
     
     
          'Les taux
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxAFPp = Format(RS![TauxAFPp], "#,##0.00%")
            End If
            RS.Close
     
             SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxAFPs = Format(RS![TauxAFPs], "#,##0.00%")
            End If
            RS.Close
            '________________
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxCnssPp = Format(RS![TauxCnssPp], "#,##0.00%")
            End If
            RS.Close
     
             SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxCnssPs = Format(RS![TauxCnssPs], "#,##0.00%")
            End If
            RS.Close
            '_______________
     
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxAmoPp = Format(RS![TauxAmoPp], "#,##0.00%")
            End If
            RS.Close
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxAmoPs = Format(RS![TauxAmoPs], "#,##0.00%")
            End If
            RS.Close
            '_____________________
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxTFPPp = Format(RS![TauxTFPPp], "#,##0.00%")
            End If
            RS.Close
     
     
             SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                TauxTFPPs = Format(RS![TauxTFPPs], "#,##0.00%")
            End If
            RS.Close
     
     
    'Igr
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarIgrB = Format(RS![Igr], "#,##0.00")
            End If
            RS.Close
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "') and (Periode='" & CStr(CmbPeriode) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            If RS![NomComplet] = VarNomBulletin Then
                VarArrondisB = Format(RS![Arrondis], "#,##0.00")
            End If
            RS.Close
     
     
    '_Les cumuls
     
     
            SQLs = "select sum(HN) from TableQuinzaines where ((Societe='" & CStr(VarSociete) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulHNB = Format(RS.Fields(0), "#,##0.00")
            La = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(SalBrut) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulSalBrutB = Format(RS.Fields(0), "#,##0.00")
     
            RS.Close
     
     
            SQLs = "select sum(CotCnss) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulCotCnssB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(CotAmo) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulAmoB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(Igr) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulIgrB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(Arrondis) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulArrondisB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(SalNet) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
     
            VarCumulSalNetB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
     
     
            SQLs = "select sum(BaseImposable) from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NomComplet='" & CStr(VarNomBulletin) & "'))"
     
            If RS.State = adStateOpen Then RS.Close
            RS.Open SQLs, DB, adOpenKeyset, adLockPessimistic
     
            VarCumulSalImpB = Format(RS.Fields(0), "#,##0.00")
            RS.Close
    '_________________________________________
     
     
            Dim Decomp, Var200, Var100, Var50, Var20, Var10, Var5, Var2, Var1 As Double
     
            Var200 = VarSalNetB \ 200
            Decomp = VarSalNetB - (Var200 * 200)
     
            Var100 = Decomp \ 100
            Decomp = Decomp - (Var100 * 100)
     
            Var50 = Decomp \ 50
            Decomp = Decomp - (Var50 * 50)
     
            Var20 = Decomp \ 20
            Decomp = Decomp - (Var20 * 20)
     
            Var10 = Decomp \ 10
            Decomp = Decomp - (Var10 * 10)
     
            Var5 = Decomp \ 5
            Decomp = Decomp - (Var5 * 5)
     
            Var2 = Decomp \ 2
            Decomp = Decomp - (Var2 * 2)
     
            Var1 = Decomp \ 1
    '___________________________________________________
            On Error Resume Next
     
            AdBulletin.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\InstMezAppSPointage\MezAppSPointage\BDAgafruit.mdb;Persist Security Info=False"
     
            SQLs = "select * from TableQuinzaines where ((Dossier='" & CStr(VarDossier) & "') and (NOrdre=" & CInt(I) & ") and (Matricule='" & CStr(VarMatriculeB) & "'))"
     
            AdBulletin.RecordSource = SQLs
     
            Set DRBulletin.DataSource = AdBulletin
     
     
            DRBulletin.Sections("Section4").Controls("LSte").Caption = VarSociete
            DRBulletin.Sections("Section4").Controls("LAdresse").Caption = VarAdresseB
            DRBulletin.Sections("Section4").Controls("LAffiliation").Caption = VarAffiliation
            DRBulletin.Sections("Section4").Controls("LPeriode").Caption = VarPeriodeB
            DRBulletin.Sections("Section4").Controls("lNomComplet").Caption = VarNomBulletin
     
            DRBulletin.Sections("Section4").Controls("LService").Caption = VarServiceB
            DRBulletin.Sections("Section4").Controls("LMatricule").Caption = VarMatriculeB
            DRBulletin.Sections("Section4").Controls("LPOSTE").Caption = VarPosteB
            DRBulletin.Sections("Section4").Controls("LCnss").Caption = VarCnssB
            DRBulletin.Sections("Section4").Controls("LCin").Caption = VarCinB
            DRBulletin.Sections("Section4").Controls("lAdresseO").Caption = VarAdresseOB
     
            DRBulletin.Sections("Section4").Controls("LStatut").Caption = VarStatutB
            DRBulletin.Sections("Section4").Controls("LNbreEnfant").Caption = VarNbreEnfantB
            DRBulletin.Sections("Section4").Controls("LNbreDeduction").Caption = VarNbreDeductionB
            DRBulletin.Sections("Section4").Controls("LDateNaissance").Caption = VarDateNaissanceB
            DRBulletin.Sections("Section4").Controls("LDateEntree").Caption = VarDateEntreeB
            DRBulletin.Sections("Section4").Controls("LModePaiement").Caption = VarModePaiementB
     
            DRBulletin.Sections("Section2").Controls("LSalBase").Caption = Format(VarSalBaseB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LNbre").Caption = Format(VarHNB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGain").Caption = Format(VarGainHNB, "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LPxHS").Caption = Format(VHS1B, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LHS").Caption = Format(VarHSB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGainS").Caption = Format(VarGainSB, "#,##0.00")
     
     
            DRBulletin.Sections("Section2").Controls("LPxHF").Caption = Format(PxHFB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LHF").Caption = Format(VarHFB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGainF").Caption = Format(VarGainFB, "#,##0.00")
     
     
            DRBulletin.Sections("Section2").Controls("LPxHR").Caption = Format(PxHRB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LHR").Caption = Format(VarHRB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGainR").Caption = Format(VarGainRB, "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LPxHT").Caption = Format(PxHTB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LHT").Caption = Format(VarHTB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGainT").Caption = Format(VarGainTB, "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LTotal").Caption = Format((VarTotalB), "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LAnc").Caption = Format(VarTauxAncB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LGainAnc").Caption = Format(VarMtAncB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LSalBrut").Caption = Format(VarTotalB, "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LCotCnss").Caption = Format(VarCotB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LCotAmo").Caption = Format(VarCotAmoB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LArrondis").Caption = Format(VarArrondisB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LIgr").Caption = Format(VarIgrB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LSalNet").Caption = Format(VarSalNetB, "#,##0.00")
     
     
            DRBulletin.Sections("Section2").Controls("LTotalCotPS").Caption = Format(VarCotB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LTotalCotPP").Caption = Format(VarTotalCotPp, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LCotPS").Caption = Format(VarCotCnssPsB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LAmoPS").Caption = Format(VarCotAmoPsB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LCotPP").Caption = Format(VarCotCnssPpB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LAmoPP").Caption = Format(VarCotAmoPpB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LAFPP").Caption = Format(VarCotAFPpB, "#,##0.00")
            DRBulletin.Sections("Section2").Controls("LTFPPP").Caption = Format(VarCotTFPPpB, "#,##0.00")
     
            DRBulletin.Sections("Section2").Controls("LTauxCotPS").Caption = TauxCnssPs
            DRBulletin.Sections("Section2").Controls("LTauxCotPP").Caption = TauxCnssPp
            DRBulletin.Sections("Section2").Controls("LTauxAmoPS").Caption = TauxAmoPs
            DRBulletin.Sections("Section2").Controls("LTauxAmoPP").Caption = TauxAmoPp
            DRBulletin.Sections("Section2").Controls("LTauxAFPS").Caption = TauxAFPs
            DRBulletin.Sections("Section2").Controls("LTauxAFPP").Caption = TauxAFPp
            DRBulletin.Sections("Section2").Controls("LTauxTFPPS").Caption = TauxTFPPs
            DRBulletin.Sections("Section2").Controls("LTauxTFPPP").Caption = TauxTFPPp
     
            DRBulletin.Sections("Section5").Controls("LCumulHN").Caption = VarCumulHNB
            DRBulletin.Sections("Section5").Controls("LCumulSalBrut").Caption = VarCumulSalBrutB
            DRBulletin.Sections("Section5").Controls("LCumulCot").Caption = VarCumulCotCnssB
            DRBulletin.Sections("Section5").Controls("LCumulAmo").Caption = VarCumulAmoB
            DRBulletin.Sections("Section5").Controls("LCumulIgr").Caption = VarCumulIgrB
            DRBulletin.Sections("Section5").Controls("LCumulArrondis").Caption = VarCumulArrondisB
            DRBulletin.Sections("Section5").Controls("LCumulSalNet").Caption = VarCumulSalNetB
            DRBulletin.Sections("Section5").Controls("LCumulSalImp").Caption = VarCumulSalImpB
     
     
            DRBulletin.Sections("Section5").Controls("L200").Caption = Var200
            DRBulletin.Sections("Section5").Controls("L100").Caption = Var100
            DRBulletin.Sections("Section5").Controls("L50").Caption = Var50
            DRBulletin.Sections("Section5").Controls("L20").Caption = Var20
            DRBulletin.Sections("Section5").Controls("L10").Caption = Var10
            DRBulletin.Sections("Section5").Controls("L5").Caption = Var5
            DRBulletin.Sections("Section5").Controls("LDeux").Caption = Var2
            DRBulletin.Sections("Section5").Controls("LUn").Caption = Var1
     
     
            If I < NOrdreBulletinF Then
                DRBulletin.PrintReport
                GoTo Autre:
                Exit Sub
            ElseIf I = NOrdreBulletinF Then
                DRBulletin.PrintReport
                Exit For
            End If
       Autre:
    Next I
    '_______
    End Sub
    Je suis reconnaissant pour votre aide

  7. #7
    Modérateur
    Avatar de l_autodidacte
    Homme Profil pro
    Retraité : Directeur de lycée/Professeur de sciences physiques
    Inscrit en
    Juillet 2009
    Messages
    2 415
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Retraité : Directeur de lycée/Professeur de sciences physiques
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2009
    Messages : 2 415
    Points : 5 805
    Points
    5 805
    Par défaut
    Salut confrère de la retraite

    Je pense que le code de la Sub devrait être écourté le plus possible. Or sous cette forme, il est très long(aux alentours de 680 lignes de code !!) avec beaucoup d'instructions.
    A titre d'exemple :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    GainTotal = CDbl(VarGainHNB)
    GainTotal = CDbl(GainTotal) + CDbl(VarGainSB)
    GainTotal = CDbl(GainTotal) + CDbl(VarGainFB)
    GainTotal = CDbl(GainTotal) + CDbl(VarGainRB)
    GainTotal = CDbl(GainTotal) + CDbl(VarGainTB)
    pourrait être simplifié en :
    GainTotal = CDbl(VarGainHNB)+ CDbl(VarGainSB)+ CDbl(VarGainFB)+ CDbl(VarGainRB)+ CDbl(VarGainTB).
    Les instructions(trop nombreuses) de la forme DRBulletin.Sections("Section4").Controls("LSte").Caption peuvent être regroupées dans une boucle For....Next si les données sont stockées dans un tableau ou même dans fichiers du type .ini ou .txt puis lecture, affection et traitement.
    Ne pas oublier le tag si satisfait.
    Voter pour toute réponse satisfaisante avec pour encourager les intervenants.
    Balises CODE indispensables. Regardez ICI
    Toujours utiliser la clause Option Explicit(VBx, VBS ou VBA) et Ne jamais typer variables et/ou fonctions en VBS.
    Vous pouvez consulter mes contributions
    Ne pas oublier de consulter les différentes FAQs et les Cours/Tutoriels VB6/VBScript
    Ne pas oublier L'Aide VBScript et MSDN VB6 Fr

  8. #8
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut Impression de série de bulletins de paie
    Salut Mon bienfaiteur
    Vos remarques sont les bienvenues.
    Dites moi, Est ce que vous avez trouvez la faille dans l'instruction de l'impression collective?

  9. #9
    Modérateur
    Avatar de l_autodidacte
    Homme Profil pro
    Retraité : Directeur de lycée/Professeur de sciences physiques
    Inscrit en
    Juillet 2009
    Messages
    2 415
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Retraité : Directeur de lycée/Professeur de sciences physiques
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2009
    Messages : 2 415
    Points : 5 805
    Points
    5 805
    Par défaut
    Je n'ai pas vraiment trouvé l'erreur exacte mais il y a quelque chose qui me tracasse à la fin de la Sub CdImpression_Click : Essaie de mettre les lignes 3,4 et 7 en commentaire puis ajoute les paramètres comme indique ci-bas :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
           If I < NOrdreBulletinF Then
                DRBulletin.PrintReport False, rptRangeAllPages  '  ajout ici
              '  GoTo Autre: 
              '  Exit Sub  
            ElseIf I = NOrdreBulletinF Then
                DRBulletin.PrintReport  False, rptRangeAllPages  ' ajout là aussi
             '   Exit For
            End If
    Next I
    Autre: ' Ce terme devrait être en dehors de la boucle
    Une Astuce pour trouver les erreurs à une ligne précise du code : On commence par numéroter toutes les lignes du code à partir de 1 jusqu'à la fin. Ensuite on pose une condition sur les erreurs éventuelles :
    If Err.Number <> 0 Then MsgBox "Erreur n° " & CStr(Err.Number) & ":" Err.Description & " ligne=" & Erl.
    Dans le code, je n'ai pas pu voir une liaison entre le compteur I et les bulletins à imprimer; car sans cette liaison, ce compteur n'aurait pas d'effet.
    Ne pas oublier le tag si satisfait.
    Voter pour toute réponse satisfaisante avec pour encourager les intervenants.
    Balises CODE indispensables. Regardez ICI
    Toujours utiliser la clause Option Explicit(VBx, VBS ou VBA) et Ne jamais typer variables et/ou fonctions en VBS.
    Vous pouvez consulter mes contributions
    Ne pas oublier de consulter les différentes FAQs et les Cours/Tutoriels VB6/VBScript
    Ne pas oublier L'Aide VBScript et MSDN VB6 Fr

  10. #10
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut
    Bonjour

    Cette idée de numéroter les lignes est intelligente, mais je ne sais pas comment le faire.

    Pour vos recommandation de mettre certaines lignes en commentaire pour voir ce qui en decoule, une fois devant mon pc je le ferai.

    Concernant la relation compteur I et les bulletins à imprimer, s'explique par le fait que I incarne le numero de la ligne de la TableQuinzaines, car chaque ligne est l'objet d'un bulletin.

    Je verrai ce que va donner vos recommandations et je vous tiendrai au courant.
    Encore merci pour tout

  11. #11
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut
    Bonjour

    J'ai essayé votre recommandation, c'est toujours le même problème.
    Comme la TableQuinzaines objet de ma requête contient 2 lignes, à l'impression
    DRBulletin.PrintReport false, rptRangeAllPages
    au lieu d'imprimer les données des Deux lignes, elle imprime celle de la première lignes en deux exemplaires,

    J"ai essayé une autre fois avec une autre periode qui contient 3 lignes.
    Aussi elle imprime la première personne pointée durant cette période 3 fois.
    Je crois que lors de l'exécution de la boucle, l'application au lieu de passer à la ligne suivante et renvoyer ses données, elle continue à garder les données de la personne enregistrée dans la première ligne, et elle l’exécute tant de fois que le nombre de lignes.

    Je m'excuse pour tous ses messages. Je tenais à vous informer de mes démarches.
    Voilà j'ai mis cette fois la condition pour sortir de la boucle en commentaire, et l'application me renvoie les données d'une seule ligne, c' est à dire la première.
    De ce constat, je déduis que la boucle ne fonctionne pas bien.

  12. #12
    Modérateur
    Avatar de l_autodidacte
    Homme Profil pro
    Retraité : Directeur de lycée/Professeur de sciences physiques
    Inscrit en
    Juillet 2009
    Messages
    2 415
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Retraité : Directeur de lycée/Professeur de sciences physiques
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2009
    Messages : 2 415
    Points : 5 805
    Points
    5 805
    Par défaut
    Cette idée de numéroter les lignes est intelligente, mais je ne sais pas comment le faire.
    Sur une Form, un bouton de commande (Command1) et ce
    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
    Private Sub Command1_Click()   
    Dim A%, C, F As Object ' A est déclaré comme entier, mais C est un variant
    1  On Error GoTo ErrDesc
    2  Set F = CreateObject("Wscript.Shell")
    3  A = "Bonjour tout le monde" ' Ici l'erreur : on affecte à A(entier) une chaine de caractères
    4  C = Mid$(A, 1, 7)
    5  MsgBox C
     
    ErrDesc:
       If Err <> 0 Then _
       MsgBox "Erreur n° : " & Err.Number & vbNewLine _
       & "Description : " & Err.Description & vbNewLine & _
       "Erreur à la ligne n° : " & Erl, vbCritical
       Exit Sub
    End Sub
    Ne pas oublier le tag si satisfait.
    Voter pour toute réponse satisfaisante avec pour encourager les intervenants.
    Balises CODE indispensables. Regardez ICI
    Toujours utiliser la clause Option Explicit(VBx, VBS ou VBA) et Ne jamais typer variables et/ou fonctions en VBS.
    Vous pouvez consulter mes contributions
    Ne pas oublier de consulter les différentes FAQs et les Cours/Tutoriels VB6/VBScript
    Ne pas oublier L'Aide VBScript et MSDN VB6 Fr

  13. #13
    Futur Membre du Club
    Homme Profil pro
    Retraitè
    Inscrit en
    Février 2019
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Retraitè

    Informations forums :
    Inscription : Février 2019
    Messages : 24
    Points : 8
    Points
    8
    Par défaut
    Bonjour

    Je vous remercie pour le code.
    Y'a t il du nouveau concernant mon problème d'impression de série des bulletins de paie ?

  14. #14
    Membre éclairé
    Inscrit en
    Décembre 2007
    Messages
    512
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 512
    Points : 671
    Points
    671
    Par défaut
    Bonjour,

    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
     
     
    For I = J To NOrdreBulletinF 
     
         ......
         .......
     
     
         'instructions inutiles
         If I < NOrdreBulletinF Then
                DRBulletin.PrintReport
                GoTo Autre:
                Exit Sub
            ElseIf I = NOrdreBulletinF Then
                DRBulletin.PrintReport
                Exit For
            End If
       Autre:
    Next I
    '_______
    End Sub
     
    'smplifier comme ceci
     
    For I = J To NOrdreBulletinF 
     
          stop 'ici pour d"abord vérifier la valeur en pointant la souris sur NOrdreBulletinF (est-elle est correcte?)
         ......
         .......
         DRBulletin.PrintReport
     
    Next I
    '_______
    End Sub

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 4
    Dernier message: 17/04/2013, 11h46
  2. [XL-2003] (xlDialogPrinterSetup) pour une série d'impression
    Par anonymousdoubi dans le forum Macros et VBA Excel
    Réponses: 0
    Dernier message: 05/04/2010, 20h18
  3. [BPW] Impression d'une image BMP
    Par Alcatîz dans le forum Turbo Pascal
    Réponses: 13
    Dernier message: 21/08/2003, 14h34
  4. Impression dans une MDI Application
    Par Andry dans le forum Composants VCL
    Réponses: 8
    Dernier message: 19/12/2002, 08h45
  5. Créer une série dans un chart
    Par cyrose dans le forum C++Builder
    Réponses: 5
    Dernier message: 28/11/2002, 11h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo