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
Solved

ASP / VB script logic "IF" error

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Edit a page at wix.com 8 67
PHP Curl to output a url 7 47
JQuery Autocomplete Tag AJAX (Need nice script) 11 34
Reg Exp to extract Url from string asp 12 14
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.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 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