tugas 3.2 dengan fungsi enter

Private Sub Cbonpm_Click()

Dim nama, jurusan, HM As Integer

Select Case Cbonpm.Text

Case “14100251”

nama = “ABDURRAHMAN FACHRI”

jurusan = “sistem informasi”

Case “14100199”

nama = “YENI HERIDA”

jurusan = “sistem informasi”

Case “14100209”

nama = “WINDI SAFITRI”

jurusan = “sistem informasi”

Case “14100186”

nama = “AGENG PRAYUGO”

jurusan = “sistem informasi”

Case “14100167”

nama = “SITI NURJANAH”

jurusan = “sistem informasi”

Case “14100198”

nama = “SITI NURBAETI”

jurusan = “sistem informasi”

Case “14100197”

nama = “SITI ALAWIYAH”

jurusan = “sistem informasi”

Case “14100208”

nama = “SANDI ROYAN PUTRA”

jurusan = “sistem informasi”

Case “14100206”

nama = “CATUR RESTU PUTRA”

jurusan = “manajemen informatika”

Case “14100247”

nama = “RATNA SARI”

jurusan = “sistem onformasi”

End Select

Txtnama.Text = nama

Txtjurusan.Text = jurusan

Txtquis.SetFocus

End Sub

Private Sub Cmdbatal_Click()

Cbonpm.SetFocus

Cbonpm.Text = “”

Txtnama.Text = “”

Txtjurusan.Text = “”

Txtquis.Text = “”

Txttugas.Text = “”

Txtuts.Text = “”

Txtuas.Text = “”

txtna.Text = “”

txthm.Text = “”

End Sub

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub Cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(Txtquis.Text)

TUGAS = Val(Txttugas.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

txtna.Text = NA

Select Case txtna.Text

Case Is > 80

HM = “A”

Case Is > 70

HM = “B”

Case Is > 60

HM = “C”

Case Is > 50

HM = “D”

Case Is < 50

HM = “E”

End Select

txthm.Text = HM

End Sub

Private Sub Form_Load()

Cbonpm.AddItem “14100200”

Cbonpm.AddItem “14100199”

Cbonpm.AddItem “14100209”

Cbonpm.AddItem “14100217”

Cbonpm.AddItem “14100167”

Cbonpm.AddItem “14100198”

Cbonpm.AddItem “14100197”

Cbonpm.AddItem “14100208”

Cbonpm.AddItem “14100195”

Cbonpm.AddItem “14100247”

End Sub

Private Sub Txtquis_keypress(keyascii As Integer)

If keyascii = 13 Then

Txttugas.SetFocus

End If

End Sub

Private Sub Txttugas_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtuts.SetFocus

End If

End Sub

Private Sub Txtuas_keypress(keyascii As Integer)

If keyascii = 13 Then

txtna.SetFocus

QUIS = Val(Txtquis.Text)

TUGAS = Val(Txttugas.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

txtna.Text = NA

Select Case txtna.Text

Case Is > 80

HM = “A”

Case Is > 70

HM = “B”

Case Is > 60

HM = “C”

Case Is > 50

HM = “D”

Case Is < 50

HM = “E”

End Select

txthm.Text = HM

End If

End Sub

Private Sub Txtuts_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtuas.SetFocus

End If

End Sub

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s