Un petit probléme

cs_jaki19 Messages postés 11 Date d'inscription vendredi 30 mai 2003 Statut Membre Dernière intervention 19 juillet 2006 - 1 juin 2006 à 19:30
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 - 2 juin 2006 à 14:09
Bonjour ts le monde , en faite j une forme contenant plusieurs commande que je veut additionner sur une facture avec leurs prix , si par exp je click sur le bouton (+) je doit additionner ce produit sinon , si je décoche la case je doit la retrancher de la somme, par ailleurs pour le bouton (–) je doit ajouter seulement le labelle de la commande sans ni additionner ni retrancher son prix du prix total, en faite je veut une méthode plus sur q la mienne soit par une bd soit une autre .




<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /?>
 






Voilà le code que j écrit :




 







Dim mn As Single







Private Sub Check1_Click(Index As Integer)







If mns <> 1 Then








    If Optionnormal(0).Value = True Then








        If Check1(Index).Value = 1 Then








       










        mn = Labelprixnormal(Index).Caption








        tot = tot + mn








           










        ElseIf Check1(Index).Value = 0 Then








       










        mn = Labelprixnorma (Index).Caption








        tot = tot - mn








   










        End If








    Else








        If Check1(Index).Value = 1 Then








        tot = tot + Labelprixgrande(Index).Caption








        ElseIf Check1(Index).Value = 0 Then








       










        mn = Labelprixgrande(Index).Caption








        tot = tot - mn








        End If








    End If







Text1.Text = tot







End If








 








If Check1(Index).Value = 1 Then








    If mns = 1 Then








          mnscmd = mnscmd & Check1(Index).Caption & ","








         










    ElseIf pls = 1 Then








          plscmd = plscmd & Check1(Index).Caption & ","








   










    End If







End If








 









 








End Sub








 








Private Sub Commandtotal_Click()







suppl = Texttotal.Text - Frmpizza.txtprix.Text 'contient le prix de base du pizza








 








mns 0: pls 0








 








Me.Hide







End Sub








 








Private Sub Commandplus_Click()







temp = Texttotal.Text








 








For i = 0 To 29







Check1(i).Value = 0







Check1(i).Enabled = True







Next i







pls = 1







Commandplus.BackColor = &HC0E0FF







Commandmoins.BackColor = &H8000000F







mns = 0







Texttotal.Text = temp







End Sub








 








Private Sub Commandmoins_Click()







temp = Text1.Text







For i = 0 To 29








    Check1(i).Value = 0








    Check1(i).Enabled = True







Next i







mns = 1







Commandplus.BackColor = &HC0E0FF







Commandmins.BackColor = &H8000000F







pls = 0







Text1.Text = temp







End Sub








 









 








Private Sub Option1_Click(Index As Integer)







If Index = 1 Then








 









    For i = 0 To 27








    Labelprixgrande(i).Visible = True








    Next i








   










    For i = 0 To 27








    Labelprixnormal(i).Visible = False








    Next i








   









Else








    For i = 0 To 27








    Labelprixgrande(i).Visible = False








 









    Next i








   










    For i = 0 To 27








    Labelprixnormal(i).Visible = True








    Next i







End If








 








For i = 0 To 29







Check1(i).Value = 0







Next i








 








End Sub




et merci .

1 réponse

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
2 juin 2006 à 14:09
[reglement.aspx Voir le règlement de CodeS-SourceS]
0
Rejoignez-nous