IF, AND & OR statements

  reddwarfcrew 21:44 09 May 2005
Locked

I know how to do IF statements in visual basic, but how do I incorporate AND and OR statements?


ie, a simple if statement is:


if UserForm.CheckBox1 = True Then


statement


End If


But I want one that says:


if UserForm.CheckBox1 = True or CheckBox 2 = True Then


statement


End If


Thanks

  DJ Supreme 21:54 09 May 2005

I use Delphi, in VB i think you need a case statement, you should go to click here - (im Madboy as username). They will help you.

  reddwarfcrew 23:56 09 May 2005

I got my answers there. If anyone is interested it would look like:


If ((UserForm1.Checkbox1.Value = True)_

AND (UserForm1.Checkbox2.Value = True))_

OR (UserForm1.Checkbox3.Value = True)_


Then


statement


End If



'Either both the first two are checked OR just the third one'

  DieSse 00:27 10 May 2005

As I'm sure you're aware, the logic in your last post is quite different to the logic in your first.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5T review: Hands-on

See the Best Button Badge Designs of 2017

iPhone X review

Black Friday 2017 : date, sites participants & bonnes affaires