Private Sub CmdOK_Click() if (Text1.Text <> "" Or Text2.Text <> "") Then Ì = Val(Text1.Text) Æ = Val(Text2.Text) If Ì < 16 Or Ì > 150 Or Æ < 16 Or Æ > 150 Then msg = "error" Style = vbCritical MsgBox msg, Style ElseIf Ì > 16 Or Ì < 150 Then Text2.Text = (Text1.Text / 2) + 7 ElseIf Æ > 16 Or Æ < 150 Then Text1.Text = 2 * (Text2.Text) + 7 End If End If End Sub
Si AgeF [manquerait pas un morceau ici ?] donner alors AgeM = 2(ageM-7)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub CmdOK_Click() if (Text1.Text <> "" and Text2.Text <> "") Then Ì = Val(Text1.Text) Æ = Val(Text2.Text) If Ì < 16 Or Ì > 150 Or Æ < 16 Or Æ > 150 Then msg = "error" Style = vbCritical MsgBox msg, Style ElseIf Ì > 16 Or Ì < 150 Then Text2.Text = (Text1.Text / 2) + 7 ElseIf Æ > 16 Or Æ < 150 Then Text1.Text = 2 * (Text2.Text) + 7 End If End If End Sub
Private Sub Text1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _ Handles Text1.Validating Ì = Val(Text1.Text) If (Ì < 16 Or Ì > 150) Then msg = "error" style = vbCritical MsgBox(msg, style) Else Text2.Text = CStr((Ì / 2) + 7) End If End Sub