S
Simon
Hello all
I have this .................
Basically applying a filter then counting the num of records within per hour
ie 10:00 = 2 etc. But it no work , the filter works fine and sometimes the
dcount / listview counts correctly can anyone help ? I need the listview to
show the amout of records per hour , because i then apply a different filter
to show the records for each hour.
' Had to change the date format because of corupptions in access date
handling ( i have everything set to uk but it still trys to change the date
a good example is the 04/04/2004 that returned records np but any other dat
didn't work then i realised the date format was getting screwed )
DoCmd.ApplyFilter "qrySelectTaskByDate", "pwD_Date = # " &
Me.Calendar3.Month & "/" & Me.Calendar3.Day & "/" & Me.Calendar3.Year & "#"
a = 0
Me.ListView7.ListItems.Clear
Do While a <= 23
theTime = "00:00"
' this bit just makes the listview look right ie 01:00 not 1:00
If a <= 9 Then
theTime = "0" & a & ":00"
End If
theTime = a & ":00"
Set itmX = Me.ListView7.ListItems.Add(, , theTime)
' need to count jobs and put in list
s = DCount("pwD_ID", "tblpwD_", "pwD_Time Like #" & theTime & "# AND
pwD_Date Like #" & Me.Calendar3.Day & "/" & Me.Calendar3.Month & "/" &
Me.Calendar3.Year & "#")
itmX.SubItems(1) = s
a = a + 1
Loop
Cheers in advance
Simon
I have this .................
Basically applying a filter then counting the num of records within per hour
ie 10:00 = 2 etc. But it no work , the filter works fine and sometimes the
dcount / listview counts correctly can anyone help ? I need the listview to
show the amout of records per hour , because i then apply a different filter
to show the records for each hour.
' Had to change the date format because of corupptions in access date
handling ( i have everything set to uk but it still trys to change the date
a good example is the 04/04/2004 that returned records np but any other dat
didn't work then i realised the date format was getting screwed )
DoCmd.ApplyFilter "qrySelectTaskByDate", "pwD_Date = # " &
Me.Calendar3.Month & "/" & Me.Calendar3.Day & "/" & Me.Calendar3.Year & "#"
a = 0
Me.ListView7.ListItems.Clear
Do While a <= 23
theTime = "00:00"
' this bit just makes the listview look right ie 01:00 not 1:00
If a <= 9 Then
theTime = "0" & a & ":00"
End If
theTime = a & ":00"
Set itmX = Me.ListView7.ListItems.Add(, , theTime)
' need to count jobs and put in list
s = DCount("pwD_ID", "tblpwD_", "pwD_Time Like #" & theTime & "# AND
pwD_Date Like #" & Me.Calendar3.Day & "/" & Me.Calendar3.Month & "/" &
Me.Calendar3.Year & "#")
itmX.SubItems(1) = s
a = a + 1
Loop
Cheers in advance
Simon