Code Problem (1 Viewer)

dpw

Registered User.
Local time
Today, 23:44
Joined
Nov 13, 2000
Messages
21
The problem occurs when I attempt to group the following data on date (Group on: Day).
As you can see below the value for midnight on 22/1/2000 has been grouped under 21/1/2000.
Date ID
21 January 2000 22:00 1400
21 January 2000 10:00 1388
21 January 2000 21:00 1399
22 January 2000 00:00 1402
Date ID
22 January 2000 01:00 1403

Furthermore, if I enter 22/1/2000 into the parameter window for this report the following is
displayed. It is classed as 2 different dates.
Date ID
22 January 2000 00:00 1402
Date ID
22 January 2000 01:00 1403
This behaviour arises when I click a button on a form to add a time interval (a field value in
another table) onto the date field value. The button appears to be working properly but the problem above
materialises. The code for the button is as follows:

Function NEXT_CUSTOM_COUNTER1()
Dim MYDB As Database
Dim MYTABLE As Recordset
Dim NEXTCOUNTER As Variant
Set MYDB = CurrentDb
Set MYTABLE = MYDB.OpenRecordset("TBLCOUNTERTABLE1")
Application.Echo False
Forms!FRMFILTRATIONHACCP1.AllowAdditions = True
MYTABLE.Edit
NEXTCOUNTER = MYTABLE("NEXTAVAILABLECOUNTER")
MYTABLE("NEXTAVAILABLECOUNTER") = NEXTCOUNTER + MYTABLe
_("INTERVAL")
MYTABLE.Update
NEXT_CUSTOM_COUNTER1 = NEXTCOUNTER
DoCmd.RunMacro "MACRO3"

(Macro 3 simply sets the value of the date field to the value of NEXTAVAILABLECOUNTER field)

Forms!FRMFILTRATIONHACCP1.AllowAdditions = False
Application.Echo True
End Function


Any help would be greatly appreciated.
 

Users who are viewing this thread

Top Bottom