DLookUp runs too slow

BamaColtsFan

Registered User.
Local time
Today, 18:14
Joined
Nov 8, 2006
Messages
91
Hey gang!

Ok, so I'm using a DLookUp on a form (several, actually) to compute the percentage of a certain portion of my dataset. The DLookUp method works and seems to return the correct values but it takes a horribly long time populate the calculated fields. This is what I have in the control source of text boxes I am using to do the calculation:

Code:
=DSum("[Civilian]","qryStatusByCatFinal","[Status] in ('Approved','Pending')") /DLookUp("[Civilian]","qryStatusByCatFinal", "[Status] = 'Total'")

So, is there any way I can speed this up and still get the same results?

As always, Thanks in advance for any advice you can offer...
 
Each Domain function is essentially a query. You are in effect running many queries.

Do the calculation using the aggregate functions in the record source query of the form and then display them in bound txtboxes.

Create a query with the table and drag the fields into the grid. Right click on the design grid and click Totals. Play around with that until you get the data you want.

Then make a form based on the query.
 

Users who are viewing this thread

Back
Top Bottom