By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Trying to Count records on a report that meet a certain criteria.

P: 2
Trying to Count records on a report that meet a certain criteria.

Have a text box in the Report Footer that has the following in the Control Source: =Count([Record Type]="S")

This does not work. It counts ALL records whether Record Type = "S" or "M"

There is nothing unique about the records to distinguish S-type records from the M-type records.
Aug 30 '07 #1
Share this Question
Share on Google+
5 Replies


Denburt
Expert 100+
P: 1,356
try =Count(iif([Record Type]="S",1,0))
Aug 30 '07 #2

P: 2
try =Count(iif([Record Type]="S",1,0))

That looked promising, but it didn't work......thanks anyway
Aug 31 '07 #3

MGrowneyARSI
P: 90
Use a Dcount it's a Dlookup but You just replace the Dlookup with Dcount
this one should work for you as long as your just looking at one letter just set it to look at your table or query dcount("[Field_Name]", "Table/Query_Name", "[Critiria]")


'@ A Function with No Criteria @

1.) =DLookUp("[LastName]", "Employees")
-----------------------------------------------------------------------------------------------------
'@ Specifying Numeric Criteria @

1.) =DLookUp("[LastName]", "Employees", "[EmployeeID] = 7")
-----------------------------------------------------------------------------------------------------
'@ Specifying Numeric Criteria That Comes from a Field on a Form @

1.) =DLookUp("[LastName]", "Employees",
"[EmployeeID] = " & Forms![Orders]![EmployeeID])

2.) =DLookUp("[LastName]", "Employees",
"[EmployeeID] = Forms![Orders]![EmployeeID]")
----------------------------------------------------------------------------------------------------
'@ Specifying Textual Criteria @

1.) =DLookUp("[Title]", "Employees", "[LastName] = 'Callahan'")

2.) =DLookUp("[Title]", "Employees", "[LastName] = ""Callahan""")
-----------------------------------------------------------------------------------------------------
'@ Specifying Textual Criteria That Comes from a Field on a Form @

1.) =DLookup("[ContactName]", "[Customers]",
"[CustomerID]='" & Forms![Orders]![CustomerID] & "'")
-----------------------------------------------------------------------------------------------------
'@ Specifying Date Criteria @

1.) =DLookUp("[LastName]", "Employees", "[BirthDate] = #01-27-66#")
-----------------------------------------------------------------------------------------------------
'@ Specifying Multiple Fields in the Criteria @

1.) =DLookUp("[OrderID]", "Orders",
"[CustomerID] = 'SIMOB' And [EmployeeID] = 2")

2.) Result = DLookup("[OrderID]", "Orders",
"[CustomerID] = '" & CustID & "' And [EmployeeID] = " & EmpID)
-----------------------------------------------------------------------------------------------------
Aug 31 '07 #4

Denburt
Expert 100+
P: 1,356
Well I am sure there are many ways but I went and tested one and it worked so try this. Two text boxes one in the detail section named text6

=IIf([Delivery_Month]>=#1/1/2008#,1,0)

with a running total. Then the one in the footer referencing the one in the detail section.

=[text6]

You could also accomplish this using VBA using the detail on format event but then I am sure I could think of a hundred ways this one was quick and easy.

Let me know how it goes.
Aug 31 '07 #5

Denburt
Expert 100+
P: 1,356
Sorry MG saw yours after I posted.

Personally I try to avoid Dlookup when I can it really consumes the resources and depending on the report it could slow things down drastically.

Definitely a workable solution though.
Aug 31 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.