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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -