Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

More than one IF in a VB script.

Posted on 2007-03-27
5
Medium Priority
?
198 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 150 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

660 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