Hi:
I'm have a problem again the same as my previous post (counting value from
the table with two criteria) but this time one field is a number. I have
tried applying what the codes below but it returns with an error. I think,
there someting wrong with my first criteria which is a number. Test code
is
below, [DescriptionID] is a number.
MsgBox DCount("[Status]", "tblAssignment", "[DescriptionID]= """" &
Me![txtDescriptionID] & """" and [Status]=True")
Many thanks.
--
Allan -
http://allanmagtibay.hostrocket.com
Duane Hookom said:
You are just concatenating two string expressions with:
"[Assignee] =" & "'"
which can be replaced by
"[Assignee] ='"
These are exactly the same. Some people use one or the other for
convenience
or clarification.
--
Duane Hookom
MS Access MVP
--
Hi Duane:
It works, thank you for the speedy reply.
I want to understand the purpose of using the ampersand after the
equal
sign in "[Assignee] =" & "'" & Me![txtAlias] & "'" caused i just
copied
it. Thank you again.
--
Allan
:
Try this with the And... inside the quotes.
intStore = DCount("[Assignee]", "[tblAssignment]",
"[Assignee] =""" & Me![txtAlias] & """ And [Status] = False")
--
Duane Hookom
MS Access MVP
--
Hi:
intStore = DCount("[Assignee]", "[tblAssignment]", "[Assignee] =" &
"'"
&
Me![txtAlias] & "'" And [Status] = No)
I used the above codes to count the Assignee from tblAssignement
where
txtAlias in my form matches the value AND that the [Status] in my
tblAssignment is NO. I'm getting an error. It work fine if I omit
the
second
criteria. Thanks in advance.