I have a text field with values of either "2" or "M" and I'll call this [Field1]. Another field has numeric values including some with null values and I'll call this [Field2]. There are also three other text fields with some having empty strings and I'll call these [Field 3], [Field 4], and [Field 5]. I want to write an expression that checks on [Field1] to see if it is a "2" or an "M" and then once that is determined, then do one of two things.
If [Field1] = "2" then this expression...
IIf([Field3]<>"" Or [Field4]<>"","Answer A","Answer B")
So if [Field1] = "2" then if either [Field3] or [Field4] have a value, then write "Answer A". If neither one has a value, then "Answer B"
If [Field1] = "M" then this expression...
IIf([Field2]>0,IIf(IsNull([Field3])=False Or IsNull([Field5])=False,"Answer A","Answer B"),"Other")
So if [Field1]="M" then check if [Field2] is greater than zero;if [Field2] is greater than zero then if [Field3] or [Field5] has text then write "Answer A";if [Field2] is greater than zero and both [Field3] and [Field5]are empty strings, then write "Answer B";if [Field2], [Field3] and [Field5] is are either empty strings or null then write "Other".
I need my solution to be an expression that I can place in the Expression Builder...I promise, I'll pick up a VBA book at B&N!
If [Field1] = "2" then this expression...
IIf([Field3]<>"" Or [Field4]<>"","Answer A","Answer B")
So if [Field1] = "2" then if either [Field3] or [Field4] have a value, then write "Answer A". If neither one has a value, then "Answer B"
If [Field1] = "M" then this expression...
IIf([Field2]>0,IIf(IsNull([Field3])=False Or IsNull([Field5])=False,"Answer A","Answer B"),"Other")
So if [Field1]="M" then check if [Field2] is greater than zero;if [Field2] is greater than zero then if [Field3] or [Field5] has text then write "Answer A";if [Field2] is greater than zero and both [Field3] and [Field5]are empty strings, then write "Answer B";if [Field2], [Field3] and [Field5] is are either empty strings or null then write "Other".
I need my solution to be an expression that I can place in the Expression Builder...I promise, I'll pick up a VBA book at B&N!
Last edited: