Aide Formule access 2003

Résolu/Fermé
vinc02 Messages postés 148 Date d'inscription mardi 7 janvier 2014 Statut Membre Dernière intervention 16 avril 2017 - 10 févr. 2014 à 11:42
vinc02 Messages postés 148 Date d'inscription mardi 7 janvier 2014 Statut Membre Dernière intervention 16 avril 2017 - 10 févr. 2014 à 13:42
Bonjour,

J'ai saisie un code qui me permet de connaître le taux d'activité en fonction de cette activité
mais cela ne fonctionne pas.
Pouvez-vous m'aider. Voici le code :

Private Sub TauxActivite_AfterUpdate()
If Me.MoyenneActivité = 100 Then
Me.TauxActivite = 0.02
Exit Sub

End If

Select Case TauxActivite

Case Is = 101
Me.TauxActivite = 0.037
Case Is = 102
Me.TauxActivite = 0.054
Case Is = 103
Me.TauxActivite = 0.071
Case Is = 104
Me.TauxActivite = 0.88
Case Is = 105
Me.TauxActivite = 0.105
Case Is = 106
Me.TauxActivite = 0.122
Case Is = 107
Me.TauxActivite = 0.139
Case Is = 108
Me.TauxActivite = 0.156
Case Is = 109
Me.TauxActivite = 0.173
Case Is = 110
Me.TauxActivite = 0.19
Case Is = 111
Me.TauxActivite = 0.207
Case Is = 112
Me.TauxActivite = 0.224
Case Is = 113
Me.TauxActivite = 0.241
Case Is = 114
Me.TauxActivite = 0.258
Case Is = 115
Me.TauxActivite = 0.275
Case Is = 116
Me.TauxActivite = 0.292
Case Is = 117
Me.TauxActivite = 0.309
Case Is = 118
Me.TauxActivite = 0.326
Case Is = 119
Me.TauxActivite = 0.343
Case Is = 120
Me.TauxActivite = 0.36
Case Is = 121
Me.TauxActivite = 0.377
Case Is = 122
Me.TauxActivite = 0.394
Case Is = 123
Me.TauxActivite = 0.411
Case Is = 124
Me.TauxActivite = 0.428
Case Is = 125
Me.TauxActivite = 0.445
Case Is = 126
Me.TauxActivite = 0.462
Case Is = 127
Me.TauxActivite = 0.479
Case Is = 128
Me.TauxActivite = 0.496
Case Is = 129
Me.TauxActivite = 0.513
Case Is = 130
Me.TauxActivite = 0.53
Case Is = 131
Me.TauxActivite = 0.5543
Case Is = 132
Me.TauxActivite = 0.5786
Case Is = 133
Me.TauxActivite = 0.6029
Case Is = 134
Me.TauxActivite = 0.6272
Case Is = 135
Me.TauxActivite = 0.6515
Case Is = 136
Me.TauxActivite = 0.6758
Case Is = 137
Me.TauxActivite = 0.7001
Case Is = 138
Me.TauxActivite = 0.7244
Case Is = 139
Me.TauxActivite = 0.7487
Case Is = 140
Me.TauxActivite = 0.773
Case Is = 141
Me.TauxActivite = 0.7973
Case Is = 142
Me.TauxActivite = 0.8216
Case Is = 143
Me.TauxActivite = 0.8459
Case Is = 144
Me.TauxActivite = 0.8702
Case Is = 145
Me.TauxActivite = 0.8945
Case Is = 146
Me.TauxActivite = 0.9188
Case Is = 147
Me.TauxActivite = 0.9431
Case Is = 148
Me.TauxActivite = 0.9674
Case Is = 149
Me.TauxActivite = 0.9917
Case Is = 150
Me.TauxActivite = 1.016
Case Is = 151
Me.TauxActivite = 1.0403
Case Is = 152
Me.TauxActivite = 1.0646
Case Is = 153
Me.TauxActivite = 1.0889
Case Is = 154
Me.TauxActivite = 1.1132
Case Is = 155
Me.TauxActivite = 1.1375
Case Is = 156
Me.TauxActivite = 1.1618
Case Is = 157
Me.TauxActivite = 1.1861
Case Is = 158
Me.TauxActivite = 1.2104
Case Is = 159
Me.TauxActivite = 1.2347
Case Is = 160
Me.TauxActivite = 1.259
End Select
End Sub

Merci d'avance

Vincent

1 réponse

vinc02 Messages postés 148 Date d'inscription mardi 7 janvier 2014 Statut Membre Dernière intervention 16 avril 2017 10
10 févr. 2014 à 13:42
Edit :

J'ai finalement opter pour une formule =Si qui était finalement plus "simple".

Formule Si pour les intéressés : =Si(Activité=100 ;0.02 ;Si(Activité=101 ;0.037 ;Si(Activité=102 ;0.054 ;Si(Activité=103 ;0.071 ;Si(Activité=104 ;0.088 ;Si(Activité=105;0.105 ;Si(Activité=106 ;0.122 ;Si(Activité=107 ;0.139 ;Si(Activité=108 ;0.156 ;Si(Activité=109 ;0.173 ;Si(Activité=110 ;0.19 ;Si(Activité=111 ;0.207 ;Si(Activité=112 ;0.224 ;Si(Activité=113 ;0.241 ;Si(Activité=114 ;0.258 ;Si(Activité=115 ;0.275 ;Si(Activité=116 ;0.292 ;Si(Activité=117 ;0.309 ;Si(Activité=118 ;0.326 ;Si(Activité=119 ;0.343 ;Si(Activité=120 ;0.36 ;Si(Activité=121 ;0.377 ;Si(Activité=122 ;0.394 ;Si(Activité=123 ;0.411 ;Si(Activité=124 ;0.428 ;Si(Activité=125 ;0.445 ;Si(Activité=126 ;0.462 ;Si(Activité=127 ;0.479 ;Si(Activité=128 ;0.496 ;Si(Activité=129 ;0.513 ;Si(Activité=130 ;0.53 ;Si(Activité=131 ;0.5543 ;Si(Activité=132 ; 0.5786 ;Si(Activité=133 ;0.6029 ;Si(Activité=134 ;0.6272 ;Si(Activité=135 ;0.6515 ;Si(Activité=136 ;0.6758 ;Si(Activité=137 ;0.7001 ;Si(Activité=138 ;0.7244 ;Si(Activité=139 ;0.7487 ;Si(Activité=140 ;0.773 ;Si(Activité=141 ;0.7973 ;Si(Activité=142 ;0.8216 ;Si(Activité=143 ;0.8459 ;Si(Activité=144 ;0.8702 ;Si(Activité=145 ;0.8945 ;Si(Activité=146 ;0.9188 ;Si(Activité=147 ;0.9431 ;Si(Activité=148 ;0.9674 ;Si(Activité=148 ;0.9674 ;Si(Activité=149 ;0.9917 ;Si(Activité=150 ;1.016 ;Si(Activité=151 ;1.0403 ;Si(Activité=152 ;1.0646 ;Si(Activité=153 ;1.0889 ;Si(Activité=154 ;1.1132 ;Si(Activité=155 ;1.1375 ;Si(Activité=156 ;1.1618 ;Si(Activité=157 ;1.1861 ;Si(Activité=158 ;1.2104 ;Si(Activité=159 ;1.2347 ;Si(Activité=160 ;1.259)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
0