Hi Diana,
Try this, if you want to use a hard-coded value of Pending:
DCount("ResvStatus" , "[MVC Schedule]", "ResvStatus = 'Pending'")
Note: For clarity, that's a single apostrophe before and after the word
Pending with a closing double quote: ' Pending ' " )
If you want to use a string value that is available in a form (ie. not
hard-coded to one value), then use this form for the criteria portion:
"ResvStatus = '" & [Forms]![NameOfForm]![NameOfField] & "'")
For clarity, that's = ' " & [Forms]![NameOfForm]![NameOfField] & " ' " )
Tom
__________________________________________
:
Hello Tom,
Your advice helps a bit, but I am not able to get the "Criteria" part of the
code (used in the link you posted) to work. I would like to only count
records that have "Pending" listed under my Reservation Status [ResvStatus]
field. How can I narrow down the count so it includes a select number of
records rather than all of the records? Thank you.
Here is what I am using so far:
DCount("ResvStatus" , "[MVC Schedule]")
This counts all of my records. I went to the link you posted but the
examples did not help me narrow down the count.
Thanks,
Diana
__________________________________________
:
Hi David,
You can have a running count displayed next to the company name. To do this,
create a Company Name group with a group header (View > Sorting and Grouping
in report design view). Move your company name field to this header. Add an
unbound textbox in this header. Set it's Control Source to: =1 on the data
tab of the properties listing. Set Running Sum = "Over All". When you now
run the report, you should see an incrementing number next to each company
name.
If this is not to your liking, you can use an unbound textbox in the report
footer section (View > Report Header/Footer). Use a DCount function in the
control source of this textbox, as follows:
=DCount("CompanyName","tblCustomers")
This will give you a count of all CompanyNames in a table named
tblCustomers. You may need to add an optional criteria statement, which
matches any criteria applied to the report's recordsource. An example of
using criteria with the DLookup function can be found here (the criteria for
DCount would be similar):
http://www.mvps.org/access/general/gen0018.htm
If my answer has helped you, please answer yes to the question that reads
"Did this post answer the question?" at the bottom of the message thread.
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
:
I have a report that has 6 columns I have sorted and counted records just
fine. I am having difficulty just geeting the count of unique entries in just
1 column.
=Count([Company Name]) I figured this would return how many recors in this
column.
Now when I counted the records I hid the duplicates so my reurned data
Company Name
record 1
record 2
you get the idea
now I understand that if i counted the total(of company name column) the
above would be 3. What I want to do is have it retur a count of 1 for each
unique company name then add it up so I can display the total number of
unique company names.
TIA
David