Matt Greatorex
Registered User.
- Local time
- Yesterday, 19:38
- Joined
- Jun 22, 2005
- Messages
- 1,019
Okay, nice easy one for all you experts out there.
I have a table [Training_Records] that contains the fields [Employee_ID] and [Zone].
I'm trying to use DCount to set a variable, based on the number of [Employee_ID] values that have a certain [Zone] value and have more than one record in the table i.e. trained on more than one thing).
Using a query I have no problem phrasing it correctly. Here, I'm having great difficulties, for some reason.
The closest I've gotten is:
str_Criteria = "(Count([Training_Records].[Employee_ID] >1) AND ([Training_Records].[Zone] = 'DP'))"
li_No = DCount("([Employee_ID])", "[Training_Records]", str_Criteria)
I know there should be some kind of aggregate in there, but I'm stumped.
Any ideas, as usual, much appreciated.
I have a table [Training_Records] that contains the fields [Employee_ID] and [Zone].
I'm trying to use DCount to set a variable, based on the number of [Employee_ID] values that have a certain [Zone] value and have more than one record in the table i.e. trained on more than one thing).
Using a query I have no problem phrasing it correctly. Here, I'm having great difficulties, for some reason.
The closest I've gotten is:
str_Criteria = "(Count([Training_Records].[Employee_ID] >1) AND ([Training_Records].[Zone] = 'DP'))"
li_No = DCount("([Employee_ID])", "[Training_Records]", str_Criteria)
I know there should be some kind of aggregate in there, but I'm stumped.
Any ideas, as usual, much appreciated.