Thank you for the help fredg.
1) the name that displays when I open the properties is 'Cycle Date'. I
assume that's what you mean by the 'name of this control'. If I'm looking at
the wrong name, please let me know.
:
*** snipped ***
If you are looking at the control's Property sheet's Other tab, Name
property line, you are correct. "Cycle Date" should not cause #error
in this case as there is no field [Cycle Date] used in the expression.
Note: It's not a good idea to include spaces in field or table names.
"CycleDate" is as easy to read as "Cycle Date", and can be used
without the brackets.
If you use an expression as the control source, the name of that
control must not be the same as the name of any of the fields in the
expression. Access gets confused. That's why I always recommend using
an unbound control whenever you need to use an expression in a control
source.
Oftentimes a user will take a bound control (let's say bound to the
[firstReported] field. Access will, by default, name this control
"firstReported". This does not cause a problem.
However, if the user then changes the control source to an expression,
such as:
= DateDiff("d",[firstReported],[DateClosed])
and the name of the control has not been changed, Access will give an
#error.
Are you absolutely sure [firstReported] and [DateClosed] are DateTime
datatype fields, and not Text datatypes?
What do you get if you change the expression to:
=IIf(IsNull([DateClosed]),"Nothing here",
DateDiff("d",[firstReported],[DateClosed]))
If the [DateClosed] is null "Nothing here" should display.
If you still need help, please copy and paste into your message the
complete "exact" control source expression. You could have left off a
parentheses or something.