Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting a listbox value

Status
Not open for further replies.

mybers

IS-IT--Management
Mar 24, 2004
62
PH
Hello guys!

On my continuous form, a field name [remarks] has 3 value list namely: complete;incomplete;dropped

Now, I would like to get the total/Count of all the [remarks]=”complete” values only.
And the other values separately.

I have placed this on the page footer so far and still to no results.

Any quick help please…..

Thanks in advance!
 
Hi,

If your continous form is displaying all the records then one of the simple thing is to use DCount. So in your footer text box write

=Nz(DCount("Remarks","TableName","Remarks='Complete'"),0) & " record(s) found"

Let me know if you need more help.

Cheers!
ÙÇãá

It's important to learn the rules so that you know how to break them.
 
Hi Agif

It surely worked! However, the continous form is filtered by a certain parameter. Ex. Schoolyear=2003

The form is set as a subform

i.e. [forms]![frm_rcy detailed trng]![submain]![remarks]

How do I get around with this?

Thanks
 
Hi,

Well you can specify criteria in DCount expression as well. You can use criteria like

DCount("FieldName","TableName","FieldName like '2003')

or something like this

DCount("FieldName","TableName","FieldName Like '" & Forms!MyForm!TxtCriteria & "'")

In second example you need to store criteria in some invisible text box but this will make everything dynamic.



Cheers!
ÙÇãá

It's important to learn the rules so that you know how to break them.
 


Hi Agif


Sorry for not able too to explain it clearly.

On the text field: "complete" I have placed/wrote this statement:


=Nz(DCount("Remarks","tbl_training inventory","Remarks='DROPPED'"),0)

Now, it showed all the records indeed from the [tbl_training inventory],
However I would have to filter the records or count only with the parameters
[tbl_training inventory]![series]

its like having two filters in one statement. Would that be possible?



SELECT [tbl_training inventory].[training batch id], [tbl_training inventory].remarks, [tbl_training inventory].seriesauto,
FROM [tbl_training inventory]
WHERE ((([tbl_training inventory].[training batch id])=[Forms]![frm_rcy detailed trng]![series]));

In summary, I would like to get a total count of people who has a remark of "Complete" within batch series=1

I hope I have explained this clearly...please ask for more details/clarifications.

thanks
 
How about...

=Nz(DCount("Remarks","tbl_training inventory","Remarks='DROPPED' AND Schoolyear = 2003"),0)


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top