aşağıdaki kod ilköğretim okullarında ağırlıklı ortalamayı hesaplıyor. ama hata yapıyor 3,566 yi 3,57 yuyarlıyor. ilemi aşağı yuvarlayıp 3,566 yı 3,56 ya 2,395 i 2,39 yuvarlaması gerekiyor kodu düzeltebilirmisiniz.
ption Compare Database
Private Sub ActiveXDen38_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
End Sub
Private Sub Etiket40_Click()
DoCmd.GoToRecord , , acLast
a = Form_agirlik.CurrentRecord
kay = a
DoCmd.GoToRecord , , acFirst
For i = 1 To a
ActiveXDen38 = i * 100 / a
' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
'4 6 4 0 3 3 0 0 2 2 1 1 2 3 0 0 3 0
'5 6 4 0 3 3 0 0 2 2 1 1 2 3 0 0 3 0
'6 5 4 0 3 3 0 0 4 2 1 1 2 2 1 0 2 0
'7 5 4 0 3 3 1 0 4 2 1 1 2 2 0 0 2 0
'8 5 4 0 3 0 1 2 4 2 1 1 2 2 1 0 2 0
If snf = 4 Then
ag = Int(100 * (q1 * 6 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 2 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 3 + q16 * 3) / 30) / 100
s4 = Left$(ag, 5)
End If
If snf = 5 Then
ag = Int(100 * (q1 * 6 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 2 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 3 + q16 * 3) / 30) / 100
s5 = Left$(ag, 5)
End If
If snf = 6 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q14 + q16 * 2) / 30) / 100
s5 = Left$(ag, 5)
End If
If snf = 7 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q6 + q16 * 2) / 30) / 100
s7 = Left$(ag, 5)
End If
If snf = 8 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q6 + q7 * 2 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q14 + q16 * 2) / 30) / 100
s8 = Left$(ag, 5)
End If
If i = a Then
GoTo son
End If
DoCmd.GoToRecord , , acNext
Next i
son:
MsgBox "Ağırlıklı yılsonu notları işlendi"
Form_menu.Alt0.SourceObject = "menu4"
Form_menu4.ys1 = -1
End Sub
ption Compare Database
Private Sub ActiveXDen38_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
End Sub
Private Sub Etiket40_Click()
DoCmd.GoToRecord , , acLast
a = Form_agirlik.CurrentRecord
kay = a
DoCmd.GoToRecord , , acFirst
For i = 1 To a
ActiveXDen38 = i * 100 / a
' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
'4 6 4 0 3 3 0 0 2 2 1 1 2 3 0 0 3 0
'5 6 4 0 3 3 0 0 2 2 1 1 2 3 0 0 3 0
'6 5 4 0 3 3 0 0 4 2 1 1 2 2 1 0 2 0
'7 5 4 0 3 3 1 0 4 2 1 1 2 2 0 0 2 0
'8 5 4 0 3 0 1 2 4 2 1 1 2 2 1 0 2 0
If snf = 4 Then
ag = Int(100 * (q1 * 6 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 2 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 3 + q16 * 3) / 30) / 100
s4 = Left$(ag, 5)
End If
If snf = 5 Then
ag = Int(100 * (q1 * 6 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 2 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 3 + q16 * 3) / 30) / 100
s5 = Left$(ag, 5)
End If
If snf = 6 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q14 + q16 * 2) / 30) / 100
s5 = Left$(ag, 5)
End If
If snf = 7 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q5 * 3 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q6 + q16 * 2) / 30) / 100
s7 = Left$(ag, 5)
End If
If snf = 8 Then
ag = Int(100 * (q1 * 5 + q2 * 4 + q4 * 3 + q6 + q7 * 2 + q8 * 4 + q9 * 2 + q10 + q11 + q12 * 2 + q13 * 2 + q14 + q16 * 2) / 30) / 100
s8 = Left$(ag, 5)
End If
If i = a Then
GoTo son
End If
DoCmd.GoToRecord , , acNext
Next i
son:
MsgBox "Ağırlıklı yılsonu notları işlendi"
Form_menu.Alt0.SourceObject = "menu4"
Form_menu4.ys1 = -1
End Sub