Simple question (DLookup)

  • Thread starter Thread starter Dominick
  • Start date Start date
D

Dominick

Hello,

I have a form which contains about 100 controls. 75%
of the controls performs a Dcount of some sort. The other
25% perform calculations based on the Dcounts. My questio
is as follows:

How will the form perform faster, if i use an
EventProcedure for all the Dcounts and calculation or the
Expression Builder. I was also thinking of building a
query and use that as a recordset.

Any sugestions ?
Thanks in advance.
 
Dominick said:
Hello,

I have a form which contains about 100 controls. 75%
of the controls performs a Dcount of some sort. The other
25% perform calculations based on the Dcounts. My questio
is as follows:

How will the form perform faster, if i use an
EventProcedure for all the Dcounts and calculation or the
Expression Builder. I was also thinking of building a
query and use that as a recordset.

The Domain Aggregate functions are often derided as being "slow" and
"unable to utilize indexes", neither of which is true. They do however
have some overhead associated with them that make them undesirable to use
in loops, queries, and any other situation where a lot of them will be
called in a short time interval. Most of this is because each Domain
function call creates an internal object variable of the current database
object. This involves refreshing the database collections etc., and is
unnecessary and wasteful to do numerous times.

So if your code created a single instance of a database object and used it
to open recordsets, execute queries etc, and do all of your required
calculations without having to open dozens of database objects it would
likely be much more efficient than what you are doing now.

Beyond that you would have to look at the criteria that you are using in
your calculations and make sure that the fields used are indexed. That
would be beneficial regardless of whether you stay with DCounts or change
to another method.
 
Hello,

I have a form which contains about 100 controls. 75%
of the controls performs a Dcount of some sort. The other
25% perform calculations based on the Dcounts. My questio
is as follows:

Eeeeuuuwwww... that's going to be SLOW.
How will the form perform faster, if i use an
EventProcedure for all the Dcounts and calculation or the
Expression Builder.

That should be better, though the code may be hard to maintain.
I was also thinking of building a
query and use that as a recordset.

and that's the best suggestion.

A Totals query will pass through the data once. Your dlookups have to
query your table seventy-five times for each record!
 
Back
Top