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
 
Top