In that case, you'll have to concatenate in the value as previously
recommended. Also, the syntax you were using would be for Branch as a text
value. If it is a number data type, the syntax will change to:
DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = " & [Branch])
--
Wayne Morgan
MS Access MVP
"Robert_DubYa" <(E-Mail Removed)> wrote in message
news:26BC3291-A0B3-4EEC-B797-(E-Mail Removed)...
> Wayne,
>
> Thanks for your reponse. I am trying to count the number of instances a
> value appears in the month column where the value in the "Branch" = the
> value
> in the query.
>
> thanks,
> Robert
>
> "Wayne Morgan" wrote:
>
>> > DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = " &
>> > '[Branch]')
>>
>> Are you trying to concatenate in the current value of Branch? If so, try:
>>
>> DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = '" &
>> [Branch] &
>> "'")
>>
>> --
>> Wayne Morgan
>> MS Access MVP
>>
>>
>> "Robert_DubYa" <(E-Mail Removed)> wrote in message
>> news:33D647E8-95F8-46DF-AA84-(E-Mail Removed)...
>> >I am having trouble creating an expression in the following query:
>> >
>> > SELECT [tblCitemRunQty-Step5-CItemsOnly].Child,
>> > [tblCitemRunQty-Step5-CItemsOnly].Month,
>> > [tblCitemRunQty-Step5-CItemsOnly].Branch,
>> > DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = " &
>> > [Branch])
>> > AS
>> > Expr1
>> > FROM [tblCitemRunQty-Step5-CItemsOnly];
>> >
>> > the problem is in my Dcount statement:
>> >
>> > DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = " &
>> > '[Branch]').
>> >
>> > I do not use this function much so I must refresh my self each time and
>> > this
>> > time I am failing.
>> >
>> > I am trying to make this statement dynamic in the query. If I use a
>> > static
>> > value I get the result I would expect
>> >
>> > example:
>> >
>> > DCount("Month","tblCitemRunQty-Step5-CItemsOnly","[Branch] = 'myvalue'"
>> >
>> > any clue on what I am doing wrong?
>> >
>> > thanks as always.
>>
>>
>>
|