Why do I not see the results of an lIF expression in forms in my T

M

MDS_frustrated

Wrote an If expression in the form Access 2007. Function works in the form
but the results do not appear in the associated Table from which the form was
generated? The output of the IF is True = 1, and False = 0. These values
work appear correctly in the Form but are absent in the Table. On generating
a Split Form, the values appear both in the Form and Split Table of the Form,
but again not in the original Table from which the Split generated from.
Other info: Field type for the operation of the IF expression was Number
(Integer); actual formula:
IIF(DateX=Date();1;0). When DateX is the same as the current date, '1' is
displayed in a field, otherwise '0' is shown. These two values appear as
expected on the Form, but do not appear in the Table for each record
generation.
 
G

Gina Whipp

MDS,

Not sure I understand the Split Table but results for an If expression
written in a query do not automatically post to a table unless you are using
an update query.
 
F

fredg

Wrote an If expression in the form Access 2007. Function works in the form
but the results do not appear in the associated Table from which the form was
generated? The output of the IF is True = 1, and False = 0. These values
work appear correctly in the Form but are absent in the Table. On generating
a Split Form, the values appear both in the Form and Split Table of the Form,
but again not in the original Table from which the Split generated from.
Other info: Field type for the operation of the IF expression was Number
(Integer); actual formula:
IIF(DateX=Date();1;0). When DateX is the same as the current date, '1' is
displayed in a field, otherwise '0' is shown. These two values appear as
expected on the Form, but do not appear in the Table for each record
generation.

Access is working correctly. A calculated result is NOT stored in a
table. Why would you want it to? That resulting value might be correct
today, but it will certainly be incorrect tomorrow. Besides, using
your expression, into which field should Access store the value even
if it could?

Instead of trying to store that value, anytime you need the result of
that calculation, re-calculate it, either on the form or report, or in
a query.

By the way, your expression could cause confusion further down the
road. In Access, -1 is True (not 1), so someone reading your code in
the future may very well be confused when trying to further use the
calculated results.
 

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