#Error in DCOUNT

E

erinkate11

I have a report that is based on a query. At the end of this reprt
would like to have a count based on certain criteria. I am trying t
use the DCount function to do this.

The query, qry_workorder, includes the fields USER_NAME, STH_STATUS
STH_MOD_USER, and STH_CREATE_DATE, and a user can type in a specifi
date range that they want to view. I am based the report on this quer
and grouped the report by the user. In the Report footer I would lik
to have a count of all entries where STH_STATUS = 'Created'. Here i
the code I used in a text box in the footer.

=DCount( "*", "qry_workorder", "[STH_STATUS] = 'Created'")

Everytime I do this, I get #Error in the textbox! Help!

Eri
 
F

Fons Ponsioen

Is your textbox named the same as a value in your
query/table? If so rename the textbox.
Hope this helps.
Fons
 
D

Duane Hookom

It sounds to me like qry_workorder has parameter prompts. If this assumption
is correct you will not get this to function. If you want to count the
records in your report where the STH_STATUS field = "Created" then use the
expression
=Sum(Abs([STH_STATUS] = "Created"))
If this isn't what you want, replace the parameter prompts with references
to controls on a form.
 
Top