Rumus program tugas 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 s As String
txttm.Text = "20" & Left(txtnpm.Text, 2)
s = Mid(txtnpm.Text, 3, 1)
If s = "1" Then
txtjur.Text = "sistem informasi"
ElseIf s = "2" Then
txtjur.Text = "manajemen informatika"
ElseIf s = "3" Then
txtjur.Text = "teknik informatika"
ElseIf s = "4" Then
txtjur.Text = "manajemen & komp. akuntansi"
End If
s = Mid(txtnpm.Text, 4, 2)
If s = "01" Then
txtps.Text = "strata satu"
ElseIf s = "02" Then
txtps.Text = "diploma tiga"
ElseIf s = "03" Then
txtps.Text = "diploma empat"
ElseIf s = "04" Then
txtps.Text = "diploma dua"
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
Tidak ada komentar:
Posting Komentar