dcount question!

G

Guest

I have a a report derived from a query. The report has employees and there
are several fields that have a yes/no checkbox. I am trying to count the
yess' based on an employee footer this is what I have in the undbound text box
=DCount("[ChangeVOE]","[EmpID]=Query![Individual Follow Up
Query]![EmpID]","[ChangeVOE]=True")
this is giving me an error, is there someone who can help me please on this
issue?

OJ!
 
G

Guest

HI Jom,

You have 2 sets of criteria in your statement and you don't specify what
domain (table) you are using. D functions can lookup any table/query even if
it isn't in your report. Also if EMPID is already in your report you, you can
concatonate the string
as you see below.

DCount («expr», «domain», «criteria»)


=DCount("[ChangeVOE]","tblWhatever",[EmpID]= " & [EmpID] & "and
[ChangeVOE]=True")

Hope that helps,

Bearmouse
 
J

John Vinson

I have a a report derived from a query. The report has employees and there
are several fields that have a yes/no checkbox. I am trying to count the
yess' based on an employee footer this is what I have in the undbound text box
=DCount("[ChangeVOE]","[EmpID]=Query![Individual Follow Up
Query]![EmpID]","[ChangeVOE]=True")
this is giving me an error, is there someone who can help me please on this
issue?

OJ!

The second argument of DCount (or any of the domain functions) should
be the name of a Table or of a Query. It should not be an expression;
and Query! is meaningless in Access, you cannot refer to a query
collection because there isn't one in that sense.

I'm GUESSING - not being able to see the database - that you want

=DCount("[ChangeVOE]", "[Individual Follow Up Query]",
"[ChangeVOE]=True AND [EmpID] = " & [EmpID])

to search for the records in [Individual Follow Up Query] for the
currently displayed EmpID, counting only records with ChangeVOE equal
to True.

John W. Vinson[MVP]
 
G

Guest

Thanks John, that worked well for me, I appreaciate your comments and help,
they were a learning experience!

John Vinson said:
I have a a report derived from a query. The report has employees and there
are several fields that have a yes/no checkbox. I am trying to count the
yess' based on an employee footer this is what I have in the undbound text box
=DCount("[ChangeVOE]","[EmpID]=Query![Individual Follow Up
Query]![EmpID]","[ChangeVOE]=True")
this is giving me an error, is there someone who can help me please on this
issue?

OJ!

The second argument of DCount (or any of the domain functions) should
be the name of a Table or of a Query. It should not be an expression;
and Query! is meaningless in Access, you cannot refer to a query
collection because there isn't one in that sense.

I'm GUESSING - not being able to see the database - that you want

=DCount("[ChangeVOE]", "[Individual Follow Up Query]",
"[ChangeVOE]=True AND [EmpID] = " & [EmpID])

to search for the records in [Individual Follow Up Query] for the
currently displayed EmpID, counting only records with ChangeVOE equal
to True.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How do use the Dcount? 13
Access MS Access DCount function problem 0
Need Help... 4
Dcount question 6
UNION query 11
DSum Question! 1
Need Help... 5
Count number of records by date 2

Top