Update Check Box With IIF From Two Fields

O

Oarageous

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??
 
O

Ofer Cohen

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)
 
O

Oarageous

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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top