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

DCount always = 0 1

Status
Not open for further replies.

KayJen

Technical User
Joined
Oct 22, 2001
Messages
36
Location
US
I have a form called Interview. When I enter a social security number in the text box named SSAN, I would like for an adjacent unbound text box currently named SSAN_TST to count how many times the social security number appears in the database. I have a query named CountSSN which counts the SSN in the query and gives me what I am looking for, however, when I use DCount in the Form I always get 0.

My DCount Syntax is:

=DCount("SSAN","CountSSN","Where SSN = '" &Forms!Interview!SSAN & "'"

Any help as to where I have messed up would be greatly appreciated.

Thanks,
Sonny
 
try this...
=DCount("SSAN","CountSSN","Where SSN = Forms!Interview!SSAN"

Just a thought:-)
--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
you are going no-->where<--
in a dcount you dont need the word where
=DCount(&quot;SSAN&quot;,&quot;CountSSN&quot;,&quot;SSN =&quot; & Forms!Interview!SSAN)
1) what is the name of the field in the query is it ssan or ssn?
2)if the field is a text field you need
=DCount(&quot;SSAN&quot;,&quot;CountSSN&quot;,&quot;SSN ='&quot; & Forms!Interview!SSAN & &quot;'&quot;)

 
Thank both of you for your quick reply, the field was text and the solutions worked, exactly like I wanted and just the way you say it would, again, Thank You Both...

Sonny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top