DCount 2 Criteria

D

DS

Having a problem with this DCount criteria. Any help appreciated.
Thanks
DS

DCount("Sent","SalesDetails","SalesID ="& Me.SalesID and "Send=True")
 
D

Douglas J Steele

DCount("Sent","SalesDetails","SalesID =" & Me.SalesID & " and Send=True")

This assumes that SalesID is a numeric field. If it were text, you'd need to
put quotes around the contents of Me.SalesID:

DCount("Sent","SalesDetails","SalesID ='" & Me.SalesID & "' and Send=True")

where, exagerated for clarity, that's

DCount("Sent","SalesDetails","SalesID = ' " & Me.SalesID & " ' and
Send=True")
 
D

DS

Douglas said:
DCount("Sent","SalesDetails","SalesID =" & Me.SalesID & " and Send=True")

This assumes that SalesID is a numeric field. If it were text, you'd need to
put quotes around the contents of Me.SalesID:

DCount("Sent","SalesDetails","SalesID ='" & Me.SalesID & "' and Send=True")

where, exagerated for clarity, that's

DCount("Sent","SalesDetails","SalesID = ' " & Me.SalesID & " ' and
Send=True")
Thanks Doug, worked great!
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dcount -Date Criteria - Won´t find it - 0
Wrap a Line 5
SQL Syntax Problem 2
No Records Then 4
DCount and NZ 6
Type Mismatch 1
DCount Syntax 2
Replacing DCount With SQL Statement 10

Top