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!

A DCount with multiple criteria

Status
Not open for further replies.

jheiser

Programmer
Dec 19, 2003
14
US
I need to search a table to see how many times a status of open in found along with a specific computer name.

this is what i have

Count = DCount("[Status]", "EnovaBatchStatus", "[Status]= 'Open'" And "[CompuName] ='" & CompName & "'")

CompName is the name of the computer that is currently using the program.

It keeps saying type mismatch

Is there a way to use this function and search with both criteria
 
You shouldn't have the AND outside the quote strings


You need


Count = DCount("[Status]", "EnovaBatchStatus", "[Status]= 'Open' AND [CompuName] ='" & CompName & "'")



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top