Solved

ASP / VB script logic "IF" error

Posted on 2013-10-28
3
292 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

749 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