![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a problem with DCount, the following code doesn't work: DCount("[OrderDetailID]", "qryOrder", "([OrderID] = Me![OrderID] AND [CatID] = 'drink')" > 0 Please help. Thank you. Paul |
#3
| |||
| |||
|
|
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 "Paul T. RONG" <etjsk (AT) hotmail (DOT) com> wrote in message news:nt1rd.55627$ha.16262 (AT) news (DOT) chello.at... Hi, I have a problem with DCount, the following code doesn't work: DCount("[OrderDetailID]", "qryOrder", "([OrderID] = Me![OrderID] AND [CatID] = 'drink')" > 0 Please help. Thank you. Paul |
![]() |
| Thread Tools | |
| Display Modes | |
| |