Avatar of PeterBaileyUk
PeterBaileyUk

asked on 

Access date to next day

I am keeping track of blood pressure here for a friend who is in China. I get the bp on my phone which shows my local time. so I enter the local time in the time field and it adds the necessary time in the chtime field via the field update event. How can I make it populate the date field automatically to the next day once the chinese time crosses over to the next date?

Currently I have this:
Private Sub LocalTime_AfterUpdate()

Dim CurrentMonth As Integer
Dim CurrentDate As Date
Dim PreviousDate As Date
Dim StdDate As Date
Dim DaylightToday As Boolean
Dim DaylightYesterday As Boolean
Dim LResponse As Integer
Dim LocalB As Long


LocalB = biasHour(GetLocalTimeZoneBias(False))
DaylightToday = IsLocalDaylightSavingTime
If DaylightToday = False Then
' here we go back an hour to standard time so 7 hour difference
Me.ChTime.Value = Format(DateAdd("h", 7, Me.LocalTime), "Short Time")
Else
' here we go forward an hour to DST so 6 hour difference
Me.ChTime.Value = Format(DateAdd("h", 6, Me.LocalTime), "Short Time")
End If


End Sub

Open in new window

Microsoft Access

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon