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
| Public Sub Report_Activate()
Dim rst As Recordset
Me.NumStag = value1
If Nz(Me.NomSoc, "") = "" Then
Me.NomSoc.ControlSource = ""
Me.NomSoc.Value = 0
End If
Me.NomSoc = valeur1
'Set rst = CurrentDb.OpenRecordset("select NomSal from RQ_EtatNomESanchezPourTaux where LibSoc='" & Me.NomSoc & "' and NumStag=" & Me.NumStag & "")
sql = "select NomSal from RQ_EtatNomESanchezPourTaux where LibSoc='" & Me.NomSoc & "' and NumStag=" & Me.NumStag & ""
Set rst = CurrentDb.OpenRecordset(sql, dbOpenDynaset, dbReadOnly)
nb_inscrit = 0
Do While Not rst.EOF
nb_inscrit = nb_inscrit + 1
rst.MoveNext
Loop
Set rst = Nothing
Do While Not rst2.EOF
Set rst2 = CurrentDb.OpenRecordset("select NomSal from RQ_EtatNomESanchezPourTaux where LibSoc='" & Me.NomSoc.text & "' and NumStag=" & Me.NumStag.text & " and present=true")
nb_participant = nb_participant + 1
rst2.MoveNext
Loop
Set rst2 = Nothing
taux_participant = nb_participant * 100 / nb_inscrit
taux_participant = Format(taux_participant, "0.00")
End Sub |
Partager