Private Sub calcul_Click()
Dim Cot As Integer
Dim Cot1 As Integer
Dim cot2 As Integer
Dim cot3 As Integer
Dim couttotal As Integer
Dim rs As DAO.Recordset
Cot1 = 0
cot3 = 0
If Me.libelléLocal = "Hors commune" Then
Cot1 = Cot + 15
Else: Cot1 = Cot1
End If
Set rs = CurrentDb.OpenRecordset("select cotisation from categorie where categorie.libellecateg=""" & Me.libelleCateg & """;")
cot2 = rs("cotisation")
If Me.Nom = rs("Nom") And Me.CP = rs("CP") And Me.adresse = rs("Adresse") Then
cot3 = cot3 - 15
Else: Cot = cot3
End If
Me.calcul.Enabled = False
If cot3 < 0 Then
MsgBox ("un membre de votre famille est deja inscrit vous avez donc droit a une réduction de 15€")
Else
End If
couttotal = Cot1 + cot2 + cot3
cout.Caption = "votre cotisation est de " & couttotal & " €"
End Sub
Partager