Aide en access

Fermé
ponce - 13 déc. 2004 à 15:15
random Messages postés 1612 Date d'inscription vendredi 26 novembre 2004 Statut Membre Dernière intervention 30 mars 2006 - 15 déc. 2004 à 10:25
Bonjour

Je réalise une application sous ACCESS et je voudrai écrire un petit programme en Visual Basic qui me permette de calculer l’IUTS d’un salarié dont le nombre de charge varie de 0 à 7 et dont la base Imposable est comprise dans une fourchette (Voir ci dessous) ;

SAL_MENS : Salaire mensuel
PRANCIEN : Prime d’ancienneté
BASE : Base Imposable
RESULTAT : Iuts

DETERMINATION DE L’UITS SUIVANT LES CHARGES

BASE = SAL_MENS + PRANCIEN

Pour 7 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 20 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 20 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 20 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 20 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 20 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 20 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 20 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 20 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 20 %)

Pour 6 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 18 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 18 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 18 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 18 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 18 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 18 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 18 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 18 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 18 %)

Pour 5 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 16 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 16 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 16 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 16 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 16 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 16 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 16 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 16 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 16 %)

Pour 4 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = BASE × 2 % × (1 - 14 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 14 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 14 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 14 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 14 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 14 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 14 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 14 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 14 %)

Pour 3 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 12 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 12 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 12 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 12 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 12 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 12 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 12 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 12 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 12 %)

Pour 2 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 10 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 10 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 10 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 10 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 10 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 10 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 10 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 10 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 10 %)

Pour 1 Charge
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = (BASE × 2 %) × (1 - 8 %)
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = (BASE × 5 % - 300) × (1 - 8 %)
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = (BASE × 10 % - 1300) × (1 - 8 %)
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = (BASE × 17 % - 3100) × (1 - 8 %)
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = (BASE × 19 % - 4400) × (1 - 8 %)
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = (BASE × 21 % - 6000) × (1 - 8 %)
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = (BASE × 24 % - 9600) × (1 - 8 %)
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = (BASE × 27 % - 14700) × (1 - 8 %)
Si 250100 <= BASE Alors RESULTAT = (BASE × 30 % - 22200) × (1 - 8 %)

Pour 0 Charges
Si 0 <= BASE Et BASE <= 10000 Alors RESULTAT = BASE × 2 %
Si 10100 <= BASE Et BASE <= 20000 Alors RESULTAT = BASE × 5 % - 300
Si 20100 <= BASE Et BASE <= 30000 Alors RESULTAT = BASE × 10 % - 1300
Si 30100 <= BASE Et BASE <= 50000 Alors RESULTAT = BASE × 17 % - 3100
Si 50100 <= BASE Et BASE <= 80000 Alors RESULTAT = BASE × 19 % - 4400
Si 80100 <= BASE Et BASE <= 120000 Alors RESULTAT = BASE × 21 % - 6000
Si 120100 <= BASE Et BASE <= 170000 Alors RESULTAT = BASE × 24 % - 9600
Si 170100 <= BASE Et BASE <= 250000 Alors RESULTAT = BASE × 27 % - 14700
Si 250100 <= BASE Alors RESULTAT = BASE × 30 % - 22200

Votre aide me sera d’un grande importance.

Merci

3 réponses

zenon Messages postés 726 Date d'inscription jeudi 30 septembre 2004 Statut Membre Dernière intervention 13 février 2010 180
13 déc. 2004 à 23:02
Peux-tu préciser cette formule?

RESULTAT = (BASE × 27 % - 14700) × (1 - 10 %)


Faut-il comprendre ((Base X 0,27) - 14700) X 9 % ?
0
je crois que vous avez compris la formule c'est exactement ce que vous avez ecris. je vous remercie pour votre aide
0
je crois que vous avez bien comlpris la question la formule c'esty exactemlent ce que vous avez ecris
Merci
0
random Messages postés 1612 Date d'inscription vendredi 26 novembre 2004 Statut Membre Dernière intervention 30 mars 2006 155
14 déc. 2004 à 11:39
essaie de mettre tes bases dans une table
une colonne code charge
avec une colonne mini plancher de la base
une colonne maxi plafond de la base
une colonne taux1
une colonne taux 2
une colonne ecart
ensuite tu fais par requete
codecharge=codecharge
base < maxi
base >mini
rsultat=(base*taux1+ecart)*(1-taux2)
0
je crois que nous ne nous sommes pas compris en fait je voudrai ecrire un programme en visual basic à partir des formule que j'ai ennoncées.
merci pour votre aide
0
random Messages postés 1612 Date d'inscription vendredi 26 novembre 2004 Statut Membre Dernière intervention 30 mars 2006 155
15 déc. 2004 à 10:25
puisque tu y tiens
Function truc(charge As Integer, base As Currency) As Currency
Const tr1 = 10000
Const tr2 = 20000
Const tr3 = 30000
Const tr4 = 50000
Const tr5 = 80000
Const tr6 = 120000
Const tr7 = 170000
Const tr8 = 250000
Const tx1 = 0.02
Const tx2 = 0.05
Const tx3 = 0.1
Const tx4 = 0.17
Const tx5 = 0.19
Const tx6 = 0.21
Const tx7 = 0.24
Const tx8 = 0.27
Const tx9 = 0.3
Const ch1 = 0.92
Const ch2 = 0.9
Const ch3 = 0.88
Const ch4 = 0.86
Const ch5 = 0.84
Const ch6 = 0.82
Const ch7 = 0.8
Dim cal As Variant
Select Case base
Case 0 To tr1
cal = base * tx1
Case (tr1 + 100) To tr2
cal = (base * tx2) - 300
Case (tr2 + 100) To tr3
cal = (base * tx3) - 1300
Case (tr3 + 100) To tr4
cal = (base * tx4) - 3100
Case (tr4 + 100) To tr5
cal = (base * tx5) - 4400
Case (tr5 + 100) To tr6
cal = (base * tx6) - 6000
Case (tr6 + 100) To tr7
cal = (base * tx7) - 9600
Case (tr7 + 100) To tr8
cal = (base * tx8) - 14700
Case Else
cal = (base * tx9) - 22200
End Select
Select Case charge
Case 7
cal = cal * ch7
Case 6
cal = cal * ch6
Case 5
cal = cal * ch5
Case 4
cal = cal * ch4
Case 3
cal = cal * ch3
Case 2
cal = cal * ch2
Case 1
cal = cal * ch1
End Select
truc = cal
End Function
0