Solved

ASP / VB script logic "IF" error

Posted on 2013-10-28
3
299 Views
Last Modified: 2013-10-28
I have the code below, but its wrong because it will only display the region IF ALL are <> "", what I need is code that will display the region whenever at least ONE of the fields is not NULL.

--

<% If ( _
(Customfields.Fields.Item("lbl_field1").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field2").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field3").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field4").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field5").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field6").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field7").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field8").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field9").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field10").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field11").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field12").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field13").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field14").Value) <> ""  AND _
(Customfields.Fields.Item("lbl_field15").Value) <> ""  ) _

THEN %>

REGION HERE
               
<%End If%>

---
0
Comment
Question by:amucinobluedot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 250 total points
ID: 39606175
just change the word "AND" to "OR"
0
 
LVL 15

Assisted Solution

by:pateljitu
pateljitu earned 250 total points
ID: 39606176
Replace "AND _" with "OR _", this way if any of the field has value IF statement will be true.
0
 

Author Closing Comment

by:amucinobluedot
ID: 39606191
Duh (To me)
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question