Sherry N. said:
Thanks for your help. However, it doesn't quite work. I created the module
as you suggested and the number returned was double the amount of records so
I modified it a little and at least got to the point where it counts the
records.
How can I modify this code to only count when the values of my field ("All
CPT Codes Addressed")is equal to "C". Can I use an "If" statement?
Something like If strChar="C" then CountChar=1 and then assign the other
textbox's properties as running sum.
This is the code I have now that just counts all the records and doesn't
discern the "C".
Public Function CountChar(strChar As String, strText As String) As Integer
Dim pos As Integer
pos = InStr(strText, strChar)
Do Until pos = 0
CountChar = 1
pos = InStr(pos + 1, strText, strChar)
Loop
End Function
Either I'm completely confused, or this is a different
question than the one you asked earlier.
If you just want to count records where the field [All CPT
Codes Addressed] equals "C", then you don't need a running
sum text box or that function. Just set the footer's text
box expression to:
=Sum(IIF([All CPT Codes Addressed] = "C", 1, 0))
If you really need to have a running sum in the detail
section, then set its expression to:
=IIF([All CPT Codes Addressed] = "C", 1, 0)