Bonjour

Je suis trés surpris qu'à la fermeture de mon formulaire un morceau de code s'execute alors qu'il est sur un bouton onclick.
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
Private Sub Commande43_Click()
 
 
If posologie_unite = "ng/kg/min" Then
[posologie_mg/h] = posologie_valeur * 0.000001 * Forms!F_principal!Poids * 60
Else
If posologie_unite = "ng/kg/h" Then
[posologie_mg/h] = posologie_valeur * 0.000001 * Forms!F_principal!Poids
Else
If posologie_unite = "µg/kg/min" Then
[posologie_mg/h] = posologie_valeur * 0.001 * Forms!F_principal!Poids * 60
Else
If posologie_unite = "µg/kg/h" Then
[posologie_mg/h] = posologie_valeur * 0.001 * Forms!F_principal!Poids
Else
If posologie_unite = "mg/kg/min" Then
[posologie_mg/h] = posologie_valeur * Forms!F_principal!Poids * 60
Else
If posologie_unite = "mg/kg/h" Then
[posologie_mg/h] = posologie_valeur * Forms!F_principal!Poids
Else
If posologie_unite = "g/kg/min" Then
[posologie_mg/h] = posologie_valeur * Forms!F_principal!Poids * 60000
Else
If posologie_unite = "g/kg/h" Then
[posologie_mg/h] = posologie_valeur * Forms!F_principal!Poids * 1000
 
End If
End If
End If
End If
End If
End If
End If
End If
end sub
Bien sur comme le formulaire est fermé, il affiche une erreur en me disant que le formulaire n'est pas trouvable.
Existe-t-il un code qui indique que si le formulaire est fermé, il ne faut pas l'exécuter ?
Merci