Kode Program Tombol Keluar :
Private Sub CmdKeluar_Click()
Unload Me
End Sub
Kode Program Tombol Lagi :
Private Sub CmdLagi_Click()
TxtNpm.Text = ""
TxtNama.Text = ""
TxtAbsen.Text = ""
TxtKuis.Text = ""
TxtTugas.Text = ""
TxtUts.Text = ""
TxtUas.Text = ""
TxtNA.Text = ""
Label2.Caption = ""
TxtNpm.SetFocus
End Sub
Kode Program Tombol Proses :
Private Sub CmdProses_Click()
TxtNA.Text = (Val(TxtAbsen.Text) + Val(TxtKuis.Text) + Val(TxtTugas.Text) + Val(TxtUts.Text) + Val(TxtUas.Text)) / 5
If TxtNA.Text >= 80 Then
Label2.Caption = " A"
ElseIf TxtNA.Text >= 73 Then
Label2.Caption = "B"
ElseIf TxtNA.Text >= 65 Then
Label2.Caption = "C"
Else
Label2.Caption = "BL"
End If
End Sub
Kode Sub Txt Absen :
Private Sub TxtAbsen_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtKuis.SetFocus
End If
End Sub
Kode Sub Txt Kuis :
Private Sub TxtKuis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTugas.SetFocus
End If
End Sub
Kode Sub Txt Nama :
Private Sub TxtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtAbsen.SetFocus
End If
End Sub
Kode Sub Txt Npm :
Private Sub TxtNpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNama.SetFocus
End If
End Sub
Kode Sub Txt Tugas :
Private Sub TxtTugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtUts.SetFocus
End If
End Sub
Kode Sub Txt Uts :
Private Sub TxtUts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtUas.SetFocus
End If
End Sub
Tidak ada komentar:
Posting Komentar