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
|
Private Sub Commande3_Click()Dim Orst As DAO.Recordset
Dim Exaperio As Double, visinonSMR As Double, visimedSMR As Double, visiembauche As Double
Dim préreprise As Double, préreprisemed As Double, préreprisesecu As Double, préreprisesal As Double
Dim reprise As Double, reprisemater As Double, reprisemaladie As Double, reprisemalpro As Double
Dim repriacci As Double, occasio As Double, occasalarié As Double, occademed As Double
Dim occaurgence As Double, occautres As Double, etudeposteIDE As Double, occaentreprise As Double
Set Orst = CurrentDb.OpenRecordset("Visite medicale", dbOpenTable)
Orst.MoveLast
LngNbEnregistrement = Orst.RecordCount
Set Orst = Nothing
' Ouverture du nouveau recordset
Set Orst = CurrentDb.OpenRecordset("Visite medicale", dbOpenForwardOnly, dbReadOnly)
ReDim montab(LngNbEnregistrement, 44)
'Effectif
For I = 1 To LngNbEnregistrement
For Y = 1 To 43 ' N'est-ce pas ici l'erreur ?
' Si tu souhaites que, plus bas, montab(I, 65) soit pris en compte
' ne faudrait-il pas écrire For Y = 1 to 65 ?
If IsNull(Orst.Fields(Y - 1)) = False Then
montab(I, Y) = Orst.Fields(Y - 1)
End If
Next Y
Orst.MoveNext
Next I
Orst.Close
Set Orst = Nothing
For I = 1 To UBound(montab)
If montab(I, 7) = "SMR" Then visimedSMR = visimedSMR + 1
If montab(I, 7) = "Non SMR" Then visinonSMR = visinonSMR + 1
If montab(I, 8) = "Visites d'embauche" Then visiembauche = visiembauche + 1
' Pré-reprise
If montab(I, 8) = "Visite de pré-reprise" Then préreprise = préreprise + 1
If montab(I, 9) = "Médecin traitant" Then préreprisemed = préreprisemed + 1
If montab(I, 9) = "Médecin-conseil de la sécurité sociale" Then préreprisesecu = préreprisesecu + 1
If montab(I, 9) = "Salarié" Then préreprisesal = préreprisesal + 1
' Visite reprise
If montab(I, 8) = "Visite de reprise" Then reprise = reprise + 1
If montab(I, 10) = "Après maternité" Then reprisemater = reprisemater + 1
If montab(I, 10) = "Après maladie" Then reprisemaladie = reprisemaladie + 1
If montab(I, 10) = "Après maladie professionelle" Then reprisemalpro = reprisemalpro + 1
If montab(I, 10) = "Après accident du travail" Then repriacci = repriacci + 1
' Visite Occasionnel
If montab(I, 8) = "Visite occasionnelle" Then occasio = occasio + 1
If montab(I, 11) = "Demande salarié" Then occasalarié = occasalarié + 1
If montab(I, 11) = "Demande medecin" Then occademed = occademed + 1
If montab(I, 11) = "Demande de l'entreprise" Then occaentreprise = occaentreprise + 1
If montab(I, 11) = "Urgences" Then occaurgence = occaurgence + 1
If montab(I, 11) = "Autres" Then occautres = occautres + 1
If montab(I, 65) = "IDE" Then etudeposteIDE = etudeposteIDE + 1
Next I
Me.PnonSMR.Value = visinonSMR
Me.PSRM.Value = visimedSMR
Me.Totexampério.Value = visimedSMR + visinonSMR
Me.visiembauche = visiembauche
Me.visipréreprise.Value = préreprise
Me.premedtraitant = préreprisemed
Me.premedsecu = préreprisesecu
Me.presalarié = préreprisesal
Me.visireprise = reprise
Me.reprimater = reprisemater
Me.reprimaladie = reprisemaladie
Me.reprimaladepro = reprisemalpro
Me.repriaccident = repriacci
Me.visiocca = occasio
Me.occsalarié.Value = occasalarié
Me.occmed = occademed
Me.occaentreprise = occaentreprise
Me.occurgences = occaurgence
Me.occaautres = occautres
Me.totnonpério = visiembauche + reprise + préreprise + occasio
Me.Totexaclinique = visiembauche + reprise + préreprise + occasio + visimedSMR + visinonSMR
Me.Totvislocide = eutudeposteIDE
End Sub |
Partager