I have a code that automatically advances the date 1 day using code, but its not working 100% the way I want it to.
I only need it to advance if the date is anything before midnight of the previous day. Example - Our third shift starts at 10:30 pm, I have an auto date entry, but it puts the date as Date(), but for our 3rd shift it is technically the next day. So when they select their shift (3) from the drop down, I would like the date to advance 1 day. I think I'm close, I think the (Now) part needs to change.
Thanks for all the help in advance.
Code:
Private Sub Shift_AfterUpdate()
If Shift = 3 Then
If LineDate = Date And Hour(Now) Then
LineDate = DateAdd("d", 1, Date)
Else
LineDate = Date
End If
End If
End Sub
Thanks for all the help in advance.
Comment