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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

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

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…