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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Combinations of fields in Group Totals 1

Status
Not open for further replies.

Comp2008

Technical User
Oct 8, 2008
32
US
I’m trying to do get a total count between two fields: [Appointment Kept] and [Internet Source]. The name of the table is “BDC Info Table”.
I have this expression which works perfectly in the Report Footer (Grand Totals)
Code:
=DCount("*","[BDC Info Table]","[Appointment Kept] = True And [Internet Source] = 'AutoUSA'")

When I type the same expression in the Group Total, it gives the same number. It doesn’t calculate as a group Total (the group name is Location Name). I tried all kind of possibilities and all my attempts failed. ex:
Code:
=DCount("*","[BDC Info Table]","[Appointment Kept] = True And [Internet Source] = 'AutoUSA' and [Location Name]")
Code:
=DCount("*","[BDC Info Table]","[Appointment Kept] = True And [Internet Source] = 'AutoUSA' and [Location Name] = & [Location Name]")

If you have any suggestions will be greatly appreciated.
Thank you in advance.

Comp2008


 
Don't use DCount() in a report if you want to calculate from records in your report or report section. You should be able to use this same control source in report and group headers and footers:
Code:
=Sum(Abs([Appointment Kept] = True And [Internet Source] = "AutoUSA"))


Duane
Hook'D on Access
MS Access MVP
 
Thank you very much dhookom. I tried the expression you gave me, and It works perfectly. You made my day. I really appreciate it.

Comp2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top