Solved

More than one IF in a VB script.

Posted on 2007-03-27
5
197 Views
Last Modified: 2010-04-16
Hi,
I am using a report designer (C1 Report Designer) that uses SQL behind it. In the report I have several group headers. Within each header I have VB script that does various things. What I want to do is create VB script that allows me to have more than one IF condition relating to that header - but how ? The If's are unrelated except that the conditions are all in the header.
Thanks.
0
Comment
Question by:brianrodda
[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
5 Comments
 
LVL 4

Expert Comment

by:jackmcbarn
ID: 18803201
Can you show me the VB script?  If it's pretty big, post it on EE-Stuff.  Otherwise, post it here.
0
 

Author Comment

by:brianrodda
ID: 18803386
Hi,
Unfortunatley I cant show it exactly for another 10 hours, but its along the lines of:

[Level3PartNumber Header].Visible = true
[Level4PartNumber Header].Visible = true
[Level5PartNumber Header].Visible = true
If LEN (Level3PartNumber) = 0 THEN
[Level2PartNumber Header].Visible = false
ELSE
[Level2PartNumber Header].Visible = true
END IF

and I wish to add something like:

If VAL (PartLocation) = "STORES" THEN
[Level2PartNumber Header].Visible = false
ELSE
[Level2PartNumber Header].Visible = true
END IF

Does that help ?
Thanks.
0
 

Accepted Solution

by:
acekracker earned 50 total points
ID: 18803572
You should be able to use:

If (LEN(Level3PartNumber) = 0) OR (Val(PartLocation) = "STORES" Then
  [Level2PartNumber Header].Visible = false
Else
  [Level2PartNumber Header].Visible = true
End If
0
 

Author Comment

by:brianrodda
ID: 18803604
I'll try it tomorrow and let you know.
Thanks for the input.
0
 

Author Comment

by:brianrodda
ID: 18842051
Hi,
Basically this works and answers my question.
Thanks for the solution.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

636 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