Unbound control ref query field error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to set the conrol source of an unbound control on a form that
references the field SumOfTime in the query qryAllTimes. I am using the
following syntax:

=[qyrAllTimes]![SumOfTime]

and I get a #Name error. What is wrong with this syntax?

Thank you.
 
Wylie,

This is invalid syntax to refer to a value from a query. Access has no
way of knowing that "[qyrAllTimes]!" is supposed to indicate a query.
Even if it did, Access would still not be able to make sense of it, as
there is no indication of which record in the query... even if the query
only returns one record, this principle would still apply. One approach
would be to use a Domain Aggregate Function. For example...
=DLookup("[SumOfTime]","qyrAllTimes")
.... may provide what you want.
 
Back
Top