Solved

More than one IF in a VB script.

Posted on 2007-03-27
5
185 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
  • 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

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

757 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

21 Experts available now in Live!

Get 1:1 Help Now