if statment problem with Micro visual studio

June 28, 2011 at 09:04:28
Specs: Windows XP
Hi all

I am trying to create a If statement in microsoft visual studio that will work.

at the moment i have this working

=if(cellname.value="happy"),field!xxxxxx.value, " ")

but when i want to put in an or statment it wont work this is how i am doing it

=if(or(cellname.value="happy", cellname.value="sad", cellname.value="ok"),field!xxxxxx.value, " ")

hopefully you can help me thanks


See More: if statment problem with Micro visual studio

Report •


#1
June 28, 2011 at 09:36:49
I don't know anything about writing formulas for Microsoft visual studio, but your formula works fine in Excel.

Since you say that your basic IF statement works, could it be that Visual Studio doesn't support the "or" operator or that the syntax is wrong?

Have you tried this as a test?

=IF(cellname.value="happy",field!xxxxxx.value,IF(cellname.value="sad",field!xxxxxx.value,IF(cellname.value="ok",field!xxxxxx.value," ")))


Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
June 29, 2011 at 01:01:48
i shall try and get back to you

Report •

#3
June 29, 2011 at 05:58:43
it wont let me use if twice lol and looking into it the program supports OR statments but i think it does not like putting them together

can anyone advise what i could do


Report •

Related Solutions

#4
June 29, 2011 at 08:04:55
Since I don't know the syntax for your application, all I can do is toss out things that work in Excel.

How about summing 3 IF's?

I don't know if 0 works for you if none of the words are present, but this works in Excel:

=IF(cellname.value ="happy",field!xxxxxx.value,0)+IF(cellname.value ="sad",field!xxxxxx.value,0)+IF(cellname.value ="OK",field!xxxxxx.value,0)

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#5
June 30, 2011 at 04:01:43
Hi all

what i am trying to put the following three formulas together

=IIf(Fields!ClassificationId.Value="VINYL", " Vinyl on Roll",Fields!ClassificationId.Value)
=IIf(Fields!ClassificationId.Value="VINYL CLEAR", " Vinyl Clear on Roll",Fields!ClassificationId.Value)
=IIf(Fields!ClassificationId.Value="POLYPROP PROFIN", "Polyprop Profin on Roll",Fields!ClassificationId.Value)

they all work indavidually but i cant link them together

help please thanks Mike


Report •

#6
June 30, 2011 at 04:41:27
Here's the main issue:

As Moderator of this forum, I'm pretty confident in saying that they aren't any Visual Studio users hanging around in this forum.

I hope you get lucky and someone who knows VS syntax sees your post, but I suggest that you also look to other forums for some help.

Good Luck!

DerbyDad03
Office Forum Moderator

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •


Ask Question