wrong expression

  • Thread starter Thread starter lynn atkinson
  • Start date Start date
L

lynn atkinson

What is wrong with the following expression?

calc date due: (DateAdd("m",[course details]!
[qualification duration],[event schedule]![date]))

This calculation works when I do it in a query, but when I
try to create the same calculation in an unbound field on
a form, I get #Name? returned in the field.

I cannot use the calculated field in created in a query
because then it interferes with the records I am trying to
select in the query. (This is another issue I am working
on!)

If anyone can explain why the expression above does not
work, I would be most grateful. Is it because the
references to the tables and the fields are not correct in
programming language for the field to find the correct
data? If so, how do I write this. The fields in question
do not appear in the query I have based the form on. Does
this matter if I refer to them long-hand.

Hope all this makes sense.
 
What object type is course details? and event schedule? If a table or query,
then the expression won't work. If a form, then the expression doesn't have
everything it needs to reference the form.

Why would a calculated field interfere in your query? That is the normal
setup used, so it may be something in what you're doing that is causing the
problem.

Assuming that course details and event schedule are tables in the query for
your form's recordsource, and that qualification duration and date (SEE NOTE
BELOW) are fields in those tables (and that neither table has a field with
the same name as the other table), your expression could be changed to this
to work:

=DateAdd("m",[qualification duration],[date])

NOTE: Also, don't use Date as a field name. It's a reserved word in ACCESS,
and ACCESS can become quite confused. See KB article number 286335 for more
info:

ACC2002: Reserved Words in Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335
 
Back
Top