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

DCount with criteria from a combobox value list

Status
Not open for further replies.

docar

Technical User
Nov 20, 2002
12
US
I have a report that's based on a parameter query (which returns records based on the date range in the parameter query)

On this report I would like to create a textfield that shows the number of records that were returned and that meet my criteria. The criteria is a value in the combobox

I put this in the controlsource:

=DCount("[myID]","myQuery","[myField]='Option1'")

myField is a combobox that has 4 options. These options are not in a separate table.

It didn't work and so I'm asking if anyone can help.

Many Thanks in advance.

 
myField is a combobox that has 4 options. These options are not in a separate table
A lookup field ?
Have a look here:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OK PHV, I put the options in a separate table but DCount still doesn't work. It gives me an error #Error.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top