One More Quick Question... 
Author Message
 One More Quick Question...

Is it possible to put two commands for an if and an else. For example:

------------------
Private Sub CommandButton2_Click()
If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then
MsgBox Message2
NumberCorrect = NumberCorrect + 1
Else
MsgBox Message1
NumberWrong = NumberWrong + 1
End If
End Sub
-------------------
will that work, and perform both commands if its '=' or not?



Tue, 17 Dec 2002 03:00:00 GMT  
 One More Quick Question...
Hi Mike,

Yes, you may place as many statements in an if-block or else-block as you
wish.

cheers, jw


Quote:
> Is it possible to put two commands for an if and an else. For example:

> ------------------
> Private Sub CommandButton2_Click()
> If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then
> MsgBox Message2
> NumberCorrect = NumberCorrect + 1
> Else
> MsgBox Message1
> NumberWrong = NumberWrong + 1
> End If
> End Sub
> -------------------
> will that work, and perform both commands if its '=' or not?



Tue, 17 Dec 2002 03:00:00 GMT  
 One More Quick Question...
Thanks for the such quick response jw...I appreciate all the help I have
been given on this newsgroup.

Quote:
> Hi Mike,

> Yes, you may place as many statements in an if-block or else-block as you
> wish.

> cheers, jw



> > Is it possible to put two commands for an if and an else. For example:

> > ------------------
> > Private Sub CommandButton2_Click()
> > If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then
> > MsgBox Message2
> > NumberCorrect = NumberCorrect + 1
> > Else
> > MsgBox Message1
> > NumberWrong = NumberWrong + 1
> > End If
> > End Sub
> > -------------------
> > will that work, and perform both commands if its '=' or not?



Tue, 17 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. One more quick question

2. ASP.NET : one quick question

3. Quick Database question - Easy one for you experienced programmers, but out my hands - Please help

4. One quick question

5. Database quick question - easy one for all you programmers - Beyond me though

6. Hello all, one quick question

7. API, WM_SETEXT, quick question, need quick answer please

8. One file question, one menu question

9. A Quick One

10. ONE PS and ONE PDF Question.

11. The quick question and the long question.

12. QUICK QUESTION:vb question/buying decision

 

 
Powered by phpBB® Forum Software