Return a value based on criteria

deejay_totoro

Registered User.
Local time
Today, 08:59
Joined
May 29, 2003
Messages
169
Hello all,

I would like to create a field that displays data from 1 or other fields, that contain data that has been keyed in by the user.

For example.
The two field are called: fldAmount1 fldAmount2

The criteria would be something like this:

fldCurrentChoice: if fldAmount1 contains data and fldAmount2 doesnt, then use fldAmount1
fldCurrentChoice: if fldAmount2 contains data fldAmount1 doesnt, then use fldAmount2
fldCurrentChoice: if fldAmount1 AND fldAmount2 contain data, then use fldAmount2

Hope someone can help!

Thanks.

dj_T
 
dj_T,

Indented for readability. I think this is it.

Code:
Iif(Not IsNull([fldAmount1]) And IsNull([fldAmount2]), 
    [fldAmount1],
    Iif(Not IsNull([fldAmount2]) And IsNull([fldAmount1]), 
        [fldAmount2],
        Iif(Not IsNull([fldAmount1]) And Not IsNull([fldAmount2]),
            [fldAmount2],
            'Neither Have Data')))

Wayne
 
Cheers!

Thanks,

Thats exactly what I was trying to work out.

dj_T
 

Users who are viewing this thread

Back
Top Bottom