Checking for 2 Nulls with IIf function

Dragonchaser

Registered User.
Local time
Today, 13:43
Joined
May 15, 2007
Messages
31
Hey there,

I've been trying various types of syntax to get this to work to no avail.

I need to check if a field is Null (used IsNull) and check if another field Null as well before having the IIf function return a true and false value.

I've tried this:
=IIf(IsNull([Forms]![SingleChamberForm]![UpstreamFitting] And [Forms]![SingleChamberForm]![USMidFlange]),"1","2")
And this:
=IIf(IsNull([Forms]![SingleChamberForm]![UpstreamFitting]) And IsNull([Forms]![SingleChamberForm]![USMidFlange]),"1","2")
And a few other combinations.
Even tried:
=IIf(IsNull([Forms]![SingleChamberForm]![UpstreamFitting] And [Forms]![SingleChamberForm]![USMidFlange]),IIf(IsNull....,"","")

Is there an easier solution to this, or is syntax just incorrect? :(

Any light someone can shed would be much appreciated.

Cheers,

Mark
 
The second test you posted should have worked. Are you sure the control is Null or is it a ZeroLengthString (ZLS)?
 
Got it to go! Thanks.
But now it's corrupted. :eek:
Won't let me compact and repair...
Am I about to learn a hard lesson in the world of Access. :(
 
Talk about Bitter/Sweet! Hope you are backed up well. Do you know all of the tricks to try? /decompile, Import to fresh db etc.
 
:) Of course this has never happened before... I've always been able to compact and back it up when it gets corrupted.
So...um....What about those tricks :)
 
Tried all the tricks. Well my backup is a couple days back... :( I guess it could be worse.:cool:
 
Sorry...but as you said, it could be worse. Those backup's pay off eventually.
 
when ive had corruptions, ive often been able to rescue it by opening a new blank dbs, and grabbing everything out of the corrupt one (often in stages!)

the other thing i had was that data corruptions called problems. so try opeinng tables to see if there is any funny data, and delete it manually


(as well as the other ideas referred to - recompile etc etc)
 

Users who are viewing this thread

Back
Top Bottom