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

My DCount fuction is not working??

Status
Not open for further replies.

rbasram

Programmer
Sep 27, 2001
53
CA
I have a program that has to keep track of the count of the products meeting a certain criteria

the fuction is something like this.

dim total as integer

total = dcount("[number]" , " mytablename", "[number]=" myformfieldtxt)

txtsequence = taotal

What am I doing wrong...





 
You need to put the complete reference to the form's text box within the quotes.
 
Rsoor - Try this:

This will work only if your field [number] is defined as a Number field type.

total = dcount("[number]" , " mytablename", "[number]= " & myformfieldtxt)

If its defined as text try this:

total = dcount("[number]" , " mytablename", "[number]= '" & myformfieldtxt & "'")

Hope it helps - Shane
 
Thank you so much My program really worked. Thanx a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top