5. Hasil Test Mahasiswa

NAMA : RINI ASTUTI
NPM : 11100113

KODE PROGRAM

Private Sub Cmbpro_Click()

Select Case Cmbpro.Text
Case “STRATA SATU”
Case “DIPLOMA TIGA”
Case “DIPLOMA DUA”
Case “DIPLOMA SATU”
End Select
txtna.SetFocus
End Sub

Private Sub cmddata_Click()
Txtnpm.SetFocus
Txtnpm.Text = ” ”
txtnama.Text = ” ”
Cmbpro.Text = ” ”
txtna.Text = ” ”
txtnb.Text = ” ”
txtnc.Text = ” ”
txtnilai.Text = ” ”
txthm.Text = ” ”
End Sub

Private Sub cmdhapus_Click()
Dim hapus
hapus = MsgBox(“Are You Sure To Delete This Data…?”, vbQuestion + vbYesNo, “DELETE”)
If hapus = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
Else
MsgBox “Cancel To Delete…”, vbOKOnly + vbInformation, “CANCELED”
End If
End Sub

Private Sub cmdproses_Click()
Dim nilai, hm As String

txtnilai.Text = (Val(txtna.Text) + Val(txtnb.Text) + Val(txtnc.Text)) / 3

nilai = txtnilai.Text
If nilai >= “85” Then
txthm.Text = “A”
ElseIf nilai >= “75” Then
txthm.Text = “B”
ElseIf nilai >= “60” Then
txthm.Text = “C”
ElseIf nilai >= “45” Then
txthm.Text = “D”
ElseIf nilai < "45" Then
txthm.Text = "E"
End If
End Sub

Private Sub cmdsave_Click()
Data1.Refresh
With Data1.Recordset
.AddNew
.Fields("NPM") = Txtnpm.Text
.Fields("NAMA") = txtnama.Text
.Fields("PROGRAM") = Cmbpro.Text
.Fields("NILAI 1") = txtna.Text
.Fields("NILAI 2") = txtnb.Text
.Fields("NILAI 3") = txtnc.Text
.Fields("NILAI RATA") = txtnilai.Text
.Fields("HURUF MUTU") = txthm.Text
.Update
End With
Cmbpro.Enabled = True
Txtnpm = ""
txtnama = ""
Cmbpro = ""
txtna = ""
txtnb = ""
txtnc = ""
txtnilai = ""
txthm = ""
Txtnpm.SetFocus
End Sub

Private Sub cmdselesai_Click()
Unload Me
End Sub

Private Sub Form_Load()
Cmbpro.AddItem "STRATA SATU"
Cmbpro.AddItem "DIPLOMA TIGA"
Cmbpro.AddItem "DIPLOMA DUA"
Cmbpro.AddItem "DIPLOMA SATU"
End Sub

Private Sub txtna_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnb.SetFocus
End If
End Sub

Private Sub txtnb_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnc.SetFocus
End If
End Sub

Private Sub Txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Cmbpro.SetFocus
End If
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • %d bloggers like this: