replace of DCount function

P

paul

Hi,
In my Access 2000 application, I have an query result
form to display student test result, so it will list all
the class he/she attended during an period of time. On the
form, I have an count field (text box)to count how many
class pass or fail, in the control source I use DCount
funtion, it will work fine.
But I don't like the perfermance, so how can I put a SQL
statement to get the same result? I tried this:
select count(*) FROM qryName WHERE Pass_Fail="PASS", but
won't work.
Thanks for your help.
 
P

paul

-----Original Message-----
Post the SQL of the query that you're using right now.

--
Ken Snell
<MS ACCESS MVP>




.
here is my query:
SELECT class_no, class_date, pass_fail
FROM tblClass
WHERE class_no=forms!inputClassForm!classNo
 
K

Ken Snell

Oh sorry...I see . . . qryName is the query that you've posted.

You cannot use an SQL statement as the control source of a textbox.

From your description, it appears that you're using a continous forms view
for the form's display, such that all records are being displayed for the
student. In that case, perhaps you can use a Sum function in the control
source of a textbox, where you've put the textbox in the footer of the form:

=Abs(Sum(([Pass_Fail="PASS"))
 

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

Top