The WHERE part of the DCount is a string, and as you have it the string is
"DCount("[OrderDetailID]", "qryOrder", "([OrderID] = Me![OrderID] AND
[CatID]
= 'drink')" > 0
"
If the OrderID in question is, say, 42, what you really want is
DCount("[OrderDetailID]", "qryOrder", "([OrderID] = 42 AND [CatID]
= 'drink')" > 0
To get this, you need to put the reference to the control outside the
string, so that the value in the control gets used instead of the reference
to it:
DCount("[OrderDetailID]", "qryOrder", "([OrderID] = " & Me![OrderID] & " AND
[CatID]
= 'drink')" > 0
> Hi,
>
[quoted text clipped - 8 lines]
>
> Paul
Paul T. RONG - 30 Nov 2004 20:39 GMT
Dave,
Thank you very much. It works very well.
Paul
"Dave M" <dmacmurc@island.net> ????????????
:NT1rd.388827$nl.180856@pd7tw3no...
> The WHERE part of the DCount is a string, and as you have it the string is
[quoted text clipped - 30 lines]
> >
> > Paul