IIf and Check Box

M

MB

Hi Experts. I have a yes/no field called "Replace" which I would like to be
automatically "YES" (or checked on my form) if the previous field,
"ManholdCond" is "Bad."

I put this as criteria in my query in the Replace column:

IIf([ManholeCond] Like “Badâ€, True, False)

but it doesn't work. Please help.

MB
 
J

Jeff Boyce

First off, it isn't a good idea to store data that is "calculated" based on
other data. If knowing the previous field determines the yes/no field, why
bother storing the yes/no field at all?

Next, if the previous field is "Bad", ... I'm suspecting that the table
definition of [ManholdCond] is as a "lookup" data type. If so, there's your
problem. A lookup data type is held in low regard in these newsgroups
because it stores one thing (the key) but displays something else (the
lookedup value), leading to a situation in which you look for "Bad" in a
query and NEVER find it!

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

MB

That did it! Thank you, Gina.
--
MB


Gina Whipp said:
MB,

Unfortunately, that is not what you statement says, try...

IIf([ManholeCond] = "Bad", [Replace] = True,False)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MB said:
Hi Experts. I have a yes/no field called "Replace" which I would like to
be
automatically "YES" (or checked on my form) if the previous field,
"ManholdCond" is "Bad."

I put this as criteria in my query in the Replace column:

IIf([ManholeCond] Like "Bad", True, False)

but it doesn't work. Please help.

MB
 
G

Gina Whipp

You're welcome... but do heed Jeff's advice about storing calculated values
in fields. If it's just for display, ignore... if not, then just do the
calculation in the underlining query and have it display the value.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MB said:
That did it! Thank you, Gina.
--
MB


Gina Whipp said:
MB,

Unfortunately, that is not what you statement says, try...

IIf([ManholeCond] = "Bad", [Replace] = True,False)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MB said:
Hi Experts. I have a yes/no field called "Replace" which I would like
to
be
automatically "YES" (or checked on my form) if the previous field,
"ManholdCond" is "Bad."

I put this as criteria in my query in the Replace column:

IIf([ManholeCond] Like "Bad", True, False)

but it doesn't work. Please help.

MB
 

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

Similar Threads


Top