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

Access Dcount (multiple criteria) 3
Wrap a Line 5
No Records Then 4
SQL Syntax Problem 2
Access Dcount function in access 0
DCount alwaysreturning 1 0
DCount and NZ 6
DCount Problem 6

Top