[AccessD] A2K: Can't Get DCount to work

Stuart McLachlan stuart at lexacorp.com.pg
Wed May 12 01:15:19 CDT 2004


On 12 May 2004 at 13:56, Darren DICK wrote:

> Hello all
> Can anyone tell me what I am doing wrong here?
> I am trying to use dcount to determine how many occurrence of a particular date appear in a table
> In my test table there are 8 records with the date 11/05/2004 
> So... In my code below,  Msgbox intX should show 8 but it keeps showing 0 (Zero)
> 
> Dim intX As integer
> intX = DCount("[OffenceDate]", "tblOffences", "[OffenceDate] = " & Me!txtOffenceDate)
> MsgBox intX
> 

Try 
intX = DCount("[OffenceDate]", "tblOffences", "[OffenceDate] = " & 
Datevalue(Me!txtOffenceDate))
 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.






More information about the AccessD mailing list