Skip to main content

AccessTr.neT


Userform Da Saat Hesaplama

Userform Da Saat Hesaplama

#2
Merhaba Sayın @yenginoglu

Formunuzun kodlarına aşağıdaki kodları eklerseniz istediğinizi yapacaktır. Kendi kurgunuza göre ihtiyaç duyduğunuz kontrollerinizi ekler çalışmanıza uyarlarsınız. İşinizi görmesi dileğiyle...
Kod:
Private Sub CalculateTimeDifference()
    Dim EntryTime, ExitTime, TimeDifference As Date
    Dim SecondsDifference As Double
   
    On Error Resume Next
    EntryTime = CDate(Me.TextBox1.Value)    ' TextBox1 saat değerlerini al
    ExitTime = CDate(Me.TextBox2.Value)    ' Textbox2 saat değerlerini al
    On Error GoTo 0
     
    TimeDifference = ExitTime - EntryTime    ' Saat farkını hesapla
    SecondsDifference = TimeDifference * 86400    ' Farkı saniye cinsine çevir
       
    Me.TextBox3.Value = Format(TimeDifference, "hh:mm")    ' Sonucu saat formatında yaz
    Me.TextBox4.Value = SecondsDifference    ' Sonucu saniye olarak yaz
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
        CalculateTimeDifference
End Sub

Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
        CalculateTimeDifference
End Sub

Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Userform Da Saat Hesaplama - Yazar: yenginoglu - 17/11/2023, 13:18
RE: Userform Da Saat Hesaplama - Yazar: atoykan - 18/11/2023, 15:04
RE: Userform Da Saat Hesaplama - Yazar: yenginoglu - 20/11/2023, 08:50
RE: Userform Da Saat Hesaplama - Yazar: atoykan - 20/11/2023, 09:36
Task