Private Sub Cboprodi_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnilai1.SetFocus
End If
End Sub
Private Sub Cmdbaru_Click()
txtnpm.SetFocus
txtnpm.Text = ” ”
txtnama.Text = ” ”
Cboprodi.Text = ” ”
txtnilai1.Text = ” ”
txtnilai2.Text = ” ”
txtnilai3.Text = ” ”
txtrata.Text = ” ”
txtHuruf.Text = ” ”
End Sub
Private Sub cmdhapus_Click()
Dim hapus
hapus = MsgBox(“Anda yakin data ini akan dihapus?”, vbQuestion + vbYesNo, “Hapus Data”)
If hapus = vbYes Then
data1.Recordset.Delete
data1.Recordset.MoveLast
Else
MsgBox “Data tidak jadi dihapus!”, vbOKOnly + vbInformation, “Batal Menghapus”
End If
End Sub
Private Sub cmdProses_Click()
Dim NA As Integer
Dim HM As String
NA = (Val(txtnilai1.Text) + Val(txtnilai2.Text) + Val(txtnilai3.Text)) / 3
txtrata.Text = NA
Select Case txtrata.Text
Case Is >= 80
HM = “A”
Case Is >= 75
HM = “B”
Case Is >= 60
HM = “C”
Case Is >= 45
HM = “D”
Case Is < 45
HM = “E”
End Select
txtHuruf.Text = HM
End Sub
Private Sub cmdselesai_Click()
Unload Me
End Sub
Private Sub cmdsimpan_Click()
data1.Refresh
With data1.Recordset
.AddNew
.Fields(“NPM”) = txtnpm.Text
.Fields(“NAMA”) = txtnama.Text
.Fields(“PRODI”) = Cboprodi.Text
.Fields(“NILAI1”) = txtnilai1.Text
.Fields(“NILAI2”) = txtnilai2.Text
.Fields(“NILAI3”) = txtnilai3.Text
.Fields(“ANGKA”) = txtrata.Text
.Fields(“HURUF”) = txtHuruf.Text
.Update
End With
Cboprodi.Enabled = True
txtnpm.SetFocus
End Sub
Private Sub Form_Load()
Cboprodi.AddItem “STRATA SATU”
Cboprodi.AddItem “DIPLOMA TIGA”
Cboprodi.AddItem “DIPLOMA DUA”
Cboprodi.AddItem “DIPLOMA SATU”
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Cboprodi.SetFocus
End If
End Sub
Private Sub txtnilai1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnilai2.SetFocus
End If
End Sub
Private Sub txtnilai2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnilai3.SetFocus
End If
End Sub
Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub










