Selasa, 12 Desember 2017

Tugas 3.2


Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub cmdproses_Click()
Dim i As String
txttm.Text = "20" & Left(txtnpm.Text, 2)
i = Mid(txtnpm.Text, 3, 1)
If i = "1" Then
txtjur.Text = "Sistem Informasi"
ElseIf i = "2" Then
txtjur.Text = "Manajemen Informatika"
ElseIf i = "3" Then
txtjur.Text = "Teknik Informatika"
ElseIf i = "4" Then
txtjur.Text = "Manajemen & Komp.Akuntansi"
End If

i = Mid(txtnpm.Text, 4, 2)
If i = "01" Then
txtps.Text = "Strata satu"
ElseIf i = "02" Then
txtps.Text = "Diploma 1"
ElseIf i = "03" Then
txtps.Text = "Diploma 2"
ElseIf i = "04" Then
txtps.Text = "Diploma 3"
End If
txturut.Text = Right(txtnpm.Text, 3)
End Sub


Private Sub Form_Activate()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub txtnama_keypress(keyascii As Integer)
If keyascii = 13 Then
txtnpm.SetFocus
End If
End Sub

0 komentar:

Posting Komentar