Haklısın... Değişiklik yaptım acil incelermisin. Çıkacağım...
Please return your positive or negative ...
Private Sub hesap_Click()
On Error GoTo hesap_Click_HATA
Dim rs As DAO.Recordset
Dim db As Database
Dim strSQL As String
Dim DK As Long
Dim SA As Long
Dim Tr1, Tr2
Tr1 = IIf(IsNull(araa1), DMin("KALKIS_TARIHI", "TBL_SEYIR_SURESI"), araa1)
Tr2 = IIf(IsNull(araa2), DMax("KALKIS_TARIHI", "TBL_SEYIR_SURESI"), araa2)
Set db = CurrentDb()
strSQL = "SELECT TBL_SEYIR_SURESI.* " & _
"FROM TBL_SEYIR_SURESI " & _
";"
Set rs = db.OpenRecordset(strSQL)
Me.sonuc = 0
DK = 0
SA = 0
If rs.EOF = True Then GoTo 90
rs.MoveFirst
Do Until rs.EOF
If (aysecim = 1 Or rs!AYLAR = aykutu) And _
(unsursec = 1 Or rs!GOREV_UNSURU = unsurkutu) And _
(gorevsec = 1 Or rs!GOREV_1 = gorevkutu Or rs!GOREV_2 = gorevkutu Or rs!GOREV_3 = gorevkutu) And _
(tarıhsec = 1 Or (rs!KALKIS_TARIHI >= CDate(Tr1)) And rs!KALKIS_TARIHI <= CDate(Tr2)) _
Then
SA = IIf(gorevsec = 1 Or rs!GOREV_1 = gorevkutu, SA + Nz(Left(rs!GOREV_1_SURE, 2), 0), SA)
DK = IIf(gorevsec = 1 Or rs!GOREV_1 = gorevkutu, DK + Nz(Mid(rs!GOREV_1_SURE, 4, 2), 0), DK)
SA = IIf(gorevsec = 1 Or rs!GOREV_2 = gorevkutu, SA + Nz(Left(rs!GOREV_2_SURE, 2), 0), SA)
DK = IIf(gorevsec = 1 Or rs!GOREV_2 = gorevkutu, DK + Nz(Mid(rs!GOREV_2_SURE, 4, 2), 0), DK)
SA = IIf(gorevsec = 1 Or rs!GOREV_3 = gorevkutu, SA + Nz(Left(rs!GOREV_3_SURE, 2), 0), SA)
DK = IIf(gorevsec = 1 Or rs!GOREV_3 = gorevkutu, DK + Nz(Mid(rs!GOREV_3_SURE, 4, 2), 0), DK)
End If
100
rs.MoveNext
Loop
90
Me.sonuc = (SA + Int(DK / 60)) & ":" & (DK - (Int(DK / 60) * 60))
hesap_Click_CIKIS: Exit Sub
hesap_Click_HATA: MsgBox "Hatalı işlem yaptınız. ", vbCritical, "Hata#"
Resume hesap_Click_CIKIS
End Sub