troubleshooting Question

Access date to next day

Avatar of PeterBaileyUk
PeterBaileyUk asked on
Microsoft Access
14 Comments1 Solution71 ViewsLast Modified:
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")
' 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
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros