Update Check Box With IIF From Two Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have two fields [target_adjacent] and [tanks or filling stations]

[target_adjacent] is a text field with a list box (target, adjacent (N),
adjacent (S), adjacent (E), adjacent (W)). [tanks or filling stations] is a
check box with a yes/no format.

I have two columns I need to update, each being represented by a check box;
target and adjacent

In the control source of the adjacent check box I have written:

=IIf([target_adjacent] like "*adjacent*",IIf(Sum([tanks or filling
stations])<0,-1,0))

Basically, when I have a record of adjacent* and there is a tank or filling
station I want the adjacent check box to update correctly by planing a check
box.

So far this is not working properly. Any ideas??
 
The [tanks or filling stations] , you said it a Yes/No field, why do you
perform Sum on it, do you want to check if it's True?

Try something like
=IIf([target_adjacent] like "*adjacent*" And [tanks or filling stations] =
True, True, False)
 
Still no luck. I get a "0" if tanks or filling stations is checked off in a
row where adjacent is entered.



Ofer Cohen said:
The [tanks or filling stations] , you said it a Yes/No field, why do you
perform Sum on it, do you want to check if it's True?

Try something like
=IIf([target_adjacent] like "*adjacent*" And [tanks or filling stations] =
True, True, False)

--
Good Luck
BS"D


Oarageous said:
Hello,

I have two fields [target_adjacent] and [tanks or filling stations]

[target_adjacent] is a text field with a list box (target, adjacent (N),
adjacent (S), adjacent (E), adjacent (W)). [tanks or filling stations] is a
check box with a yes/no format.

I have two columns I need to update, each being represented by a check box;
target and adjacent

In the control source of the adjacent check box I have written:

=IIf([target_adjacent] like "*adjacent*",IIf(Sum([tanks or filling
stations])<0,-1,0))

Basically, when I have a record of adjacent* and there is a tank or filling
station I want the adjacent check box to update correctly by planing a check
box.

So far this is not working properly. Any ideas??
 
Back
Top