Tugas VB Membuat Data Mahasiswa

3

Private Sub Command1_Click()
Dim a As String
tahun.Text = “20″ & Left(NPM.Text, 2)
a = Mid(NPM.Text, 3, 1)
If a = “1″ Then
jr = “sistem informasi”
ElseIf a = “2″ Then
jr = “manajemen informatika”
ElseIf a = “3″ Then
jr = ” teknik informatika”
ElseIf a = “4″ Then
jr = “komputer akuntansi”
End If

jurusan.Text = jr
a = Mid(NPM.Text, 4, 2)
If a = “01″ Then
ps = “strata satu”
ElseIf a = “02″ Then
ps = “diploma empat”
ElseIf ps = “03″ Then
ps = “diploma tiga”
ElseIf ps = “04″ Then
ps = “diploma dua”
End If

program.Text = ps
no.Text = Right(NPM.Text, 3)
End Sub

Private Sub Command2_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jurusan.Text = “”
program.Text = “”
tahun.Text = “”
no.Text = “”
End Sub

Private Sub Command3_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jurusan.Text = “”
program.Text = “”
tahun.Text = “”
no.Text = “”
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub nama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
NPM.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 )

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s