Solved

More than one IF in a VB script.

Posted on 2007-03-27
5
194 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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

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