Timer - До события (Нового Года) осталось …По материалам: https://www.cyberforum.ru/ms-access/thread3065293.html Private Sub FormTimeUPD() Dim dStart As Date Dim dTemp As Date dStart = Nz(Me.txtDateFrom, Date) + TimeValue(Now) Me.txtTimeFrom = dStart If DateSerial(2023, 1, 1) > dStart Then dTemp = DateSerial(2023, 1, 1) - dStart Me.txtДней = DateDiff("d", dStart, DateSerial(2023, 1, 1)) - 1 Me.txtЧасов = Format(dTemp, "h") Me.txtМинут = Format(dTemp, "n") Me.txtСекунд = Format(dTemp, "s") Else Me.txtДней = 0 Me.txtЧасов = 0 Me.txtМинут = 0 Me.txtСекунд = 0 End If End Sub Private Sub Form_Load() FormTimeUPD End Sub Private Sub Form_Timer() FormTimeUPD End Sub Private Sub txtDateFrom_AfterUpdate() FormTimeUPD End Sub MSA-2007 и выше ( 37 kB) Пример |
|||
L.E. 25.05.2023 |