IIF Statement help

H

Heather

I'm trying to configure two fields using if statements...
how do I go about writing the logic? For instance...

If Field 1 = Field 2, then 0, if not, then 1

any advice would be appreciated.

Thanks.
Heather
 
K

Kevin Sprinkel

In general, you can find syntax on VB functions by
invoking Help from the VB Editor. You can activate the VB
Editor by pressing <Ctrl>-G from the Database Window.

The syntax for the IIF() function is:
IIF(<condition>,<value if true>, <value if false>)

Assuming you are trying to assign a value to a third field
based on the values in Field 1 and Field 2, set the
control source of the third field to:

=IIf([Field 1]=[Field 2],0,1)

However, it seems that if this is what you're trying to
do, the field is not really necessary, since you can
always calculate this value on the fly in a query. If
you're trying to do something different, please post more
detail.

HTH
Kevin Sprinkel
 
Top