Code Comments
Programming Forum and web based access to our favorite programming groups.I get no result when I add these variables.
{@SharedBonnen} + {@SharedContract} + {@SharedImproductief} +
{@SharedProject} + {@SharedRelatie}
(VB.Net 2003 with CR.)
The problem is caused by NULL values.
I read in this newsgroup something about If Is NULL then...
but I couldn't get it working.
Can anybody tell me how to do this?
Kind regards,
Alison.
Post Follow-up to this messageYou will want to use the "IsNull" keyword (note that this is one word).
For instance:
Dim Value As Number
If Not IsNull({@SharedBonnen}) then
Value = Value + {@SharedBonnen}
End If
If Not IsNull({@SharedContract}) then
Value = Value + {@SharedContract}
End If
...etc.
Jay Taplin [MCP - VB]
Post Follow-up to this messageAlison, If you follow the my posting carefully, that you referenced, it
should work fine as follows:
If IsNull({Field1}) Then
{Field2}+{Field3}+{Field4}+{Field5}
Else If IsNull({Field}) Then
{Field1}+{Field3}+{Field4}+{Field5}
Else If IsNull({HATB.BUKT3}) Then
{Field1}+{Field2}+{Field4}+{Field5}
Else If IsNull({Field}) Then
{Field1}+{Field2}+{Field3}+{Field5}
Else
{Field1}+{Field2}+{Field3}+{Field4}+{Fie
ld5}
"Alison Givens" wrote:
> I get no result when I add these variables.
> {@SharedBonnen} + {@SharedContract} + {@SharedImproductief} +
> {@SharedProject} + {@SharedRelatie}
>
> (VB.Net 2003 with CR.)
>
> The problem is caused by NULL values.
> I read in this newsgroup something about If Is NULL then...
> but I couldn't get it working.
>
> Can anybody tell me how to do this?
>
> Kind regards,
> Alison.
>
>
>
>
>
Post Follow-up to this messageUnfortunately, that solution will not work for a couple of reasons. 1) In your Else If IsNull(xxx) lines, the "xxx" does not have the valid field names. 2) If you have more than one field that has nulls, the formula will still error out (ex. Field1 and Field2 are NULL). I'd do them all separately, as in my post.
Post Follow-up to this messageThanks guys,
I enhanced the formula to this and it works:
If IsNull ({@SharedReisCorrect}) then 0 else {@SharedReisCorrect} + If
IsNull ({@SharedReisDubbel}) then 0 else {@SharedReisDubbel} + If IsNull
({@SharedReisFoutief}) then 0 else {@SharedReisFoutief}
Alison.
"Jay Taplin" <jaytaplin@integraware.com> wrote in message
news:1138651268.612627.144020@o13g2000cwo.googlegroups.com...
> Unfortunately, that solution will not work for a couple of reasons. 1)
> In your Else If IsNull(xxx) lines, the "xxx" does not have the valid
> field names. 2) If you have more than one field that has nulls, the
> formula will still error out (ex. Field1 and Field2 are NULL).
>
> I'd do them all separately, as in my post.
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.