vba - creating a loop around my select Case -


at present, have functioning select case states if textbox blank highlighted red, seems highlighting 1 of textboxes. instance, if 2 textboxes left blank, highlights first on comes across.

select case true     case me.custname = ""     me.custname.backcolor = &h8080ff     case me.regaddress = ""     me.regaddress.backcolor = &h8080ff     case me.postinput = ""     me.postinput.backcolor = &h8080ff     case me.landline = ""     me.landline.backcolor = &h8080ff     case me.contact = ""     me.contact.backcolor = &h8080ff     case me.dobinput = ""     me.dobinput.backcolor = &h8080ff end select 

being new vba, thinking create loop round current code state (loop until x,y or z <> "") can't seem figure out how this.

any advice appreciated.

select case runs code block following first matching case statement only. if need check each of conditions regardless, should write them individual if statements instead:

if me.custname   = "" me.custname.backcolor   = &h8080ff if me.regaddress = "" me.regaddress.backcolor = &h8080ff if me.postinput  = "" me.postinput.backcolor  = &h8080ff .... 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -