Solved

ASP / VB script logic "IF" error

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now