I am fighting with Access to find a way to use Query with aggregate functions
to update table. One hard way is to make table from Query and then update
another table. Another way is to use Dlookup function, but it is very slow.
Am I overlooking an alternate way? or is there a way to speed up Dlookup?
Thanks in advance.
No Aggregate query is ever updateable (even if it logically ought to
be). It's just a limitation of the program.
Is it *ESSENTIAL* to store this calculation? It's rarely a good idea.
Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.
Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
If you must store it (perhaps this is a case where the calculation is
in fact too slow), you may be able to speed up the domain functions by
indexing the fields used in the criteria, if they don't already have
indexes.
John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps