R
RipperT
I have a form into which users log data categorized by date and time. The
forms date field default value is set to =Date(). However, entries made on
our 3rd shift (10pm - 6am) after midnight need to belong to the previous
days date (the date on which the shift began). I would like to code the
default value of date field so this is taken care of. Is the following even
close?
Private Sub Form_Current()
Dim MyDate
Dim MyTime
MyDate = Date
MyTime = Time
IF MyTime >=#12:01:00 AM# and MyTime <=#6:00:00 am# THEN
Me.Date.DefaultValue = (MyDate-1)
ELSE
Me.Date.DefaultValue = MyDate
End If
End Sub
Many thanx,
Ripper
forms date field default value is set to =Date(). However, entries made on
our 3rd shift (10pm - 6am) after midnight need to belong to the previous
days date (the date on which the shift began). I would like to code the
default value of date field so this is taken care of. Is the following even
close?
Private Sub Form_Current()
Dim MyDate
Dim MyTime
MyDate = Date
MyTime = Time
IF MyTime >=#12:01:00 AM# and MyTime <=#6:00:00 am# THEN
Me.Date.DefaultValue = (MyDate-1)
ELSE
Me.Date.DefaultValue = MyDate
End If
End Sub
Many thanx,
Ripper