Brendan gave you a solution for an Access Data Project. If you are using an
.mdb (DAO) you need a slightly different solution.
One thing you might look at is the DCount Function
SomeVariable = DCount("WORK_REQ_ID","VIAWARE_WCS_TO_VIA_T","DTIMEMOD Between
[cal1] And [cal2]")
If Cal1 and Cal2 are parameters you are inputing then you will need to construct
the "Where" string with the proper delimiters and the values of Cal1 and Cal2.
Something like the following. Also Access in this situation expects dates to be
in US mm/DD/yyyy format or in yyyy/mm/dd format.
"DTIMEMOD Between #" & [cal1] & "# And #" & [cal2] & #"
If you are trying to get a count of the unique values for Work_Req_ID then post
back as this shouldn't do that.
> Public Sub DisplayCount()
>
[quoted text clipped - 24 lines]
> >
> > DoCmd.RunSQL (vSql)
Brendan Reynolds - 23 Jun 2005 18:26 GMT
Actually, John, the solution I posted does not require an ADP. It just
requires an ADO reference - which Access 2000 and later add by default. You
and I might remove that reference if we're not using it, but less
experienced developers are unlikely to do so.

Signature
Brendan Reynolds (MVP)
> Brendan gave you a solution for an Access Data Project. If you are using
> an
[quoted text clipped - 49 lines]
>> >
>> > DoCmd.RunSQL (vSql)