27/05/2021, 15:33
berduş
SaatTpl fonksiyonunu aşağıdaki gibi düzenleyip dener misiniz?
Private Sub SaatTpl(Optional id As Long)
StrAlan = ""
For x = 1 To 31
StrDgr = Format(x, "00")
StrDgr = "IIf(IsNumeric(E" & StrDgr & ") , cdbl(E" & StrDgr & "),0)"
StrAlan = StrAlan & " + " & StrDgr
Next x
SqlUpdt = "Update [EKDERS] " & _
"SET [ETOPSAAT] =" & StrAlan
If id > 0 Then SqlUpdt = SqlUpdt & " where ID=" & id
CurrentDb.Execute SqlUpdt
SqlUpdt = "Update [EKDERS] " & _
"SET [ETOP]=fix([ETOPSAAT]/10), [MESAI]=[ETOPSAAT]-[ETOP]*10 "
If id > 0 Then SqlUpdt = SqlUpdt & " where ID=" & id
CurrentDb.Execute SqlUpdt
End Sub