Count no. of same records

  • Thread starter Thread starter SeRene
  • Start date Start date
S

SeRene

Hi,

I have this table with this field, "Reason".
The same set of reasons may appear quite a few times in
that particular table.
For example, "Transaction error", "System error"
and "Operation in Progress" may be some of the reasons
found in that field. How can i display the total number of
records with the "Reason" field showing "Transaction
error" in a textbox? The same goes for the other reasons.
Display the total number of records with the same reason
in a textbox.

Thanks!
 
It sounds like you need to create a Group By query (View
Totals), then base your form on that query. It will give
you the reason and the number of records it shows up in.
j.
 
It sounds like you need to create a Group By query (View
Totals), then base your form on that query. It will give
you the reason and the number of records it shows up in.
j.

Hi,

I've tried your method but it seems that the results arent
any different from my original table!

What i need is to display the total number of records with
the reason, "Transaction error" in a textbox, "System
error" in another textbox and "Operation in Progress" in
the 3rd textbox.
 
You might want to try creating 3 (or how many different reasons you have)
unbound textboxes, Write the reason in the Caption of the label of the
textbox and put:
=DCount("Reason","YourTableName","Reason='ActualReasonText'")
in each of the textbox's Control Source.

Hope it helps.

Alp
 
From a VBA standpoint you could use the Dcount function. Using th
reason phrase as the where condition. ("Reason = 'Phrase'"
 
You might want to try creating 3 (or how many different reasons you have)
unbound textboxes, Write the reason in the Caption of the label of the
textbox and put:
=DCount ("Reason","YourTableName","Reason='ActualReasonText'")
in each of the textbox's Control Source.

Hope it helps.

Alp
Hi Alp,
That's exactly what i need!!!
Thank u soooo much! =)
 
Back
Top