IF, AND & OR statements

  reddwarfcrew 21:44 09 May 05
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 05

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 05

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 05

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.

Huawei P10 review

1995-2015: How technology has changed the world in 20 years

An overview: What leading creative agencies are doing to improve diversity

New iPad, iPhone SE & Red iPhone 7 on sale now