Try a DCount statement in a calculated textbox or in code.
Example:
DCount("*", "NameOfReportsRecordSource", "[GroupID]=" & Me.txtGroupID)
If the code is in a calculated textbox, leave out the "Me.". Also, this
assumes the value to be a number, if it is a text value, you'll have to
concatenate in quotes around it also.
Example:
DCount("*", "NameOfReportsRecordSource", "[GroupID]='" & Me.txtGroupID &
"'")
or
DCount("*", "NameOfReportsRecordSource", "[GroupID]=""" & Me.txtGroupID &
"""")
For this to work, you will need to place a textbox in the group header and
bind it to this field. You can set the Visible property of the textbox to No
or False if you don't need it to show for something else.
--
Wayne Morgan
Microsoft Access MVP
"Melissa" <mb****@earthlink.net> wrote in message
news:3B*****************@newsread2.news.atl.earthl ink.net...
I have a sales report where the sales are grouped by district. The report
is
based on a query with criteria for sales date to get the sales in any
specified date range. I have code in the Format event of the district
group
header. How do I get the count of sales in the current district in the
code
in the Format event of the district group header?
Thanks!
Melissa