That'll only tell you how many rows in the table have J in txtJoiningStatus,
not how many Js there are in txtJoiningStatus.
To count how many Js are in a text box, you can use the following function
(assuming you're using Access 2000 or newer):
Function CountInstances( _
ByVal ToSearch As String, _
ByVal ToFind As String) As Long
CountInstances = (Len(ToSearch) - _
Len(Replace$(ToSearch, ToFind, vbNullString))) _
\ Len(ToFind)
End Function
In your case, you'd want something like CountInstances(Me.txtJoiningStatus,
"J")
What this does is replace all of the occurrences of ToFind with a null
string ("") and then determine how much shorter the modified string is.
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
Jim/Chris said:
If the report is based on a query add an unbound text box
with this in the Control source
=DCount("[txtJoiningStatus]","[queryname]","[txtJoiningStatus]='J'")
Jim
-----Original Message-----
I have a text Box in a report (txtJoiningStatus) in which the letters J F or
I are entered
from a form. I want to count in the report footer a textbox with the total
number of J's
that are in the report.
Any ideas, does it need a macro?
Thanks
Jim
.