raphael_george
Messages postés60Date d'inscriptionsamedi 19 novembre 2005StatutMembreDernière intervention22 octobre 2007
-
18 oct. 2007 à 21:28
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 2021
-
19 oct. 2007 à 05:30
Salut,
un peu d'aide me ferai beaucoup de bien...
Private Sub BoutABG_Click()If BoutABG.Value True Then FrmKt.TextBox1.Value frm.TextBox1.Value + " " + BoutABG.CaptionElse: If BoutABD.Value True Then FrmKt.TextBox1.Value frm.TextBox1.Value + " " + BoutABD.Caption
Else If BoutPliG.Value True Then FrmKt.TextBox1.Value frm.TextBox1.Value + " " + BoutPliG.Caption
Else If BoutPliD.Value True Then FrmKt.TextBox1.Value frm.TextBox1.Value + " " + BoutPliD.Caption
End If
End If
End If
End If
End Sub
PCPT
Messages postés13272Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201847 18 oct. 2007 à 21:54
salut,
à vouloir gagner 2 ligne avec 2 :, bien difficile de relire....
Private Sub BoutABG_Click()
Dim sStr As String
sStr = vbNullString
If BoutABG.Value Then
sStr = BoutABG.Caption
ElseIf BoutABD.Value Then
sStr = BoutABD.Caption
ElseIf BoutPliG.Value Then
sStr = BoutPliG.Caption
ElseIf BoutPliD.Value Then
sStr = BoutPliD.Caption
End If
If LenB(sStr) Then FrmKt.TextBox1.Value =
frm.TextBox1.Value & " " & sStr
End Sub
ps : si c'est vraiment du Dotnet, remplacer LenB(sStr) par sstr.lenght (je crois)
++
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp
cs_Jack
Messages postés14006Date d'inscriptionsamedi 29 décembre 2001StatutModérateurDernière intervention28 août 201579 19 oct. 2007 à 03:47
Salut
Dans un If, si tu places la commande à exécuter après le Then sur la même ligne que le If, le Else placé en dessous est orphelin, d'où l'erreur.
Il suffit donc de passer à la ligne après le Then, comme l'a dit PCPT
Une autre solution :
Puisque tu testes toujours tes données à True, tu peux utiliser un Select Case :
Select Case True
Case BoutABG.Value
FrmKt.TextBox1.Value = frm.TextBox1.Value + " " + BoutABG.Caption
Case BoutABD.Value
FrmKt.TextBox1.Value = frm.TextBox1.Value + " " + BoutABD.Caption
Case BoutPliG.Value
FrmKt.TextBox1.Value = frm.TextBox1.Value + " " + BoutPliG.Caption
Case BoutPliD.Value
FrmKt.TextBox1.Value = frm.TextBox1.Value + " " + BoutPliD.Caption
End Select
Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés
<hr />Le savoir est la seule matière qui s'accroit quand on la partage (Socrate)