if statement - If Textbox.Value = ("",<0,>1,OR <>"x") Then -


when building if statement, want call attention textbox when user form data entered not 1 of 3 approved options (1,0, or x)...

what best way write that?

here's have:

if textbox.value = ("",<0,>1,or <>"x")     textbox.backcolor = rgbpink    textboxlabel.forecolor = rgbred    textbox.setfocus    exit sub end if 

you want "if not equal to" ? in case should use <> :

if textbox.value <>"" or textbox.value<>0 or textbox.value<>1 or textbox.value<>"x"     textbox.backcolor = rgbpink    textboxlabel.forecolor = rgbred    textbox.setfocus    exit sub end if  

this enter in "if" if textbox.value different of "", or 0, or 1 or "x"....


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -