VB 1 (Tugas 3)

b

1. Enter

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

Private Sub TXTNPM_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

End If

TXTJURUSAN.Text = j

k = Mid(TXTNPM.Text, 4, 2)

If k = “01″ Then

p = “STRATA SATU”

ElseIf k = “02″ Then

p = “DIPLOMA TIGA”

ElseIf k = “03″ Then

p = “DIPLOMA DUA”

ElseIf k = “04″ Then

p = “DIPLOMA EMPAT”

End If

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 3)

End If

End Sub

b

2.  Proses

Private Sub Command1_Click()

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

End If

TXTJURUSAN.Text = j

k = Mid(TXTNPM.Text, 4, 2)

If k = “01″ Then

p = “STRATA SATU”

ElseIf k = “02″ Then

p = “DIPLOMA TIGA”

ElseIf k = “03″ Then

p = “DIPLOMA DUA”

ElseIf k = “04″ Then

p = “DIPLOMA EMPAT”

End If

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 3)

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

b

3. ENTER DAN PROSES

Private Sub Command1_Click()

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

End If

TXTJURUSAN.Text = j

k = Mid(TXTNPM.Text, 4, 2)

If k = “01″ Then

p = “STRATA SATU”

ElseIf k = “02″ Then

p = “DIPLOMA TIGA”

ElseIf k = “03″ Then

p = “DIPLOMA DUA”

ElseIf k = “04″ Then

p = “DIPLOMA EMPAT”

End If

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 3)

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

Private Sub TXTNPM_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

End If

TXTJURUSAN.Text = j

k = Mid(TXTNPM.Text, 4, 2)

If k = “01″ Then

p = “STRATA SATU”

ElseIf k = “02″ Then

p = “DIPLOMA TIGA”

ElseIf k = “03″ Then

p = “DIPLOMA DUA”

ElseIf k = “04″ Then

p = “DIPLOMA EMPAT”

End If

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 3)

End If

End Sub

b

4. ENTER

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

Private Sub TXTNPM_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

p = “STRATA SATU”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

p = “DIPLOMA TIGA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

p = “DIPLOMA DUA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

p = “DIPLOMA EMPAT”

End If

TXTJURUSAN.Text = j

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 5)

End If

End Sub

b

5. PROSES

Private Sub Command1_Click()

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

p = “STRATA SATU”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

p = “DIPLOMA TIGA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

p = “DIPLOMA DUA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

p = “DIPLOMA EMPAT”

End If

TXTJURUSAN.Text = j

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 5)

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

b

6. PROSES DAN ENTER

Private Sub Command1_Click()

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

p = “STRATA SATU”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

p = “DIPLOMA TIGA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

p = “DIPLOMA DUA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

p = “DIPLOMA EMPAT”

End If

TXTJURUSAN.Text = j

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 5)

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1 = “”

TXTNPM = “”

TXTJURUSAN = “”

TXTPRODI = “”

TXTTM = “”

TXTNU = “”

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

Private Sub TXTNPM_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p As String

k = Mid(TXTNPM.Text, 3, 1)

If k = “1″ Then

j = “SISTEM INFORMASI”

p = “STRATA SATU”

ElseIf k = “2″ Then

j = “MANAJEMEN INFORMATIKA”

p = “DIPLOMA TIGA”

ElseIf k = “3″ Then

j = “TEKNIK INFORMATIKA”

p = “DIPLOMA DUA”

ElseIf k = “4″ Then

j = “KOMPUTER AKUNTASI”

p = “DIPLOMA EMPAT”

End If

TXTJURUSAN.Text = j

TXTPRODI.Text = p

TXTTM.Text = “20″ & Left(TXTNPM.Text, 2)

TXTNU.Text = Right(TXTNPM.Text, 5)

End If

End Sub

a

7. ENTER

Private Sub Cmdbatal_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub Cmdlagi_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Txtkode_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p, h As String

kode = Left(Txtkode.Text, 3)

If kode = “SIM” Then

Txtjudul.Text = “Sistem Informasi Manajemen”

Txtpengarang.Text = “Fadiya Ulfa”

Txtharga.Text = “79500″

ElseIf kode = “EDP” Then

Txtjudul.Text = “Elektronik Data Procesing”

Txtpengarang.Text = “Nurul Agustina”

Txtharga.Text = “62000″

ElseIf kode = “MNJ” Then

Txtjudul.Text = “Manajemen”

Txtpengarang.Text = “Rian Hidayat”

Txtharga.Text = “42000″

ElseIf kode = “CDR” Then

Txtjudul.Text = “Corel Draw”

Txtpengarang.Text = “Siti Nur Khotimah”

Txtharga.Text = “53000″

ElseIf kode = “RPL” Then

Txtjudul.Text = “Rekayasa Perngkat Lunak”

Txtpengarang.Text = “Winda Erlianti”

Txtharga.Text = “83000″

End If

kode = Mid(Txtkode.Text, 8, 1)

If kode = “A” Then

Txtpenerbit.Text = “Andi Offest Yogyakarta”

ElseIf kode = “I” Then

Txtpenerbit.Text = “Indah Surabaya”

ElseIf kode = “S” Then

Txtpenerbit.Text = “Salemba Empat”

ElseIf kode = “E” Then

Txtpenerbit.Text = “Elek Media Kompotindo”

ElseIf kode = “M” Then

Txtpenerbit.Text = “Maxicom”

End If

Txttahun.Text = “20″ & Mid(Txtkode.Text, 5, 2)

a

8. PROSES

Private Sub Cmdbatal_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub Cmdlagi_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Cmdproses_Click()

Dim k, j, p, h As String

kode = Left(Txtkode.Text, 3)

If kode = “SIM” Then

Txtjudul.Text = “Sistem Informasi Manajemen”

Txtpengarang.Text = “Fadiya Ulfa”

Txtharga.Text = “79500″

ElseIf kode = “EDP” Then

Txtjudul.Text = “Elektronik Data Procesing”

Txtpengarang.Text = “Nurul Agustina”

Txtharga.Text = “62000″

ElseIf kode = “MNJ” Then

Txtjudul.Text = “Manajemen”

Txtpengarang.Text = “Rian Hidayat”

Txtharga.Text = “42000″

ElseIf kode = “CDR” Then

Txtjudul.Text = “Corel Draw”

Txtpengarang.Text = “Siti Nur Khotimah”

Txtharga.Text = “53000″

ElseIf kode = “RPL” Then

Txtjudul.Text = “Rekayasa Perngkat Lunak”

Txtpengarang.Text = “Winda Erlianti”

Txtharga.Text = “83000″

End If

kode = Mid(Txtkode.Text, 8, 1)

If kode = “A” Then

Txtpenerbit.Text = “Andi Offest Yogyakarta”

ElseIf kode = “I” Then

Txtpenerbit.Text = “Indah Surabaya”

ElseIf kode = “S” Then

Txtpenerbit.Text = “Salemba Empat”

ElseIf kode = “E” Then

Txtpenerbit.Text = “Elek Media Kompotindo”

ElseIf kode = “M” Then

Txtpenerbit.Text = “Maxicom”

End If

Txttahun.Text = “20″ & Mid(Txtkode.Text, 5, 2)

End Sub

Private Sub Txtkode_Change()

If KeyAscii = 13 Then

Cmdproses.SetFocus

End If

End Sub

a

9. PROSES DAN ENTER

Private Sub Cmdbatal_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub Cmdlagi_Click()

Txtkode.SetFocus

Txtkode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub Cmdproses_Click()

Dim k, j, p, h As String

kode = Left(Txtkode.Text, 3)

If kode = “SIM” Then

Txtjudul.Text = “Sistem Informasi Manajemen”

Txtpengarang.Text = “Fadiya Ulfa”

Txtharga.Text = “79500″

ElseIf kode = “EDP” Then

Txtjudul.Text = “Elektronik Data Procesing”

Txtpengarang.Text = “Nurul Agustina”

Txtharga.Text = “62000″

ElseIf kode = “MNJ” Then

Txtjudul.Text = “Manajemen”

Txtpengarang.Text = “Rian Hidayat”

Txtharga.Text = “42000″

ElseIf kode = “CDR” Then

Txtjudul.Text = “Corel Draw”

Txtpengarang.Text = “Siti Nur Khotimah”

Txtharga.Text = “53000″

ElseIf kode = “RPL” Then

Txtjudul.Text = “Rekayasa Perngkat Lunak”

Txtpengarang.Text = “Winda Erlianti”

Txtharga.Text = “83000″

End If

kode = Mid(Txtkode.Text, 8, 1)

If kode = “A” Then

Txtpenerbit.Text = “Andi Offest Yogyakarta”

ElseIf kode = “I” Then

Txtpenerbit.Text = “Indah Surabaya”

ElseIf kode = “S” Then

Txtpenerbit.Text = “Salemba Empat”

ElseIf kode = “E” Then

Txtpenerbit.Text = “Elek Media Kompotindo”

ElseIf kode = “M” Then

Txtpenerbit.Text = “Maxicom”

End If

Txttahun.Text = “20″ & Mid(Txtkode.Text, 5, 2)

End Sub

Private Sub Txtkode_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim k, j, p, h As String

kode = Left(Txtkode.Text, 3)

If kode = “SIM” Then

Txtjudul.Text = “Sistem Informasi Manajemen”

Txtpengarang.Text = “Fadiya Ulfa”

Txtharga.Text = “79500″

ElseIf kode = “EDP” Then

Txtjudul.Text = “Elektronik Data Procesing”

Txtpengarang.Text = “Nurul Agustina”

Txtharga.Text = “62000″

ElseIf kode = “MNJ” Then

Txtjudul.Text = “Manajemen”

Txtpengarang.Text = “Rian Hidayat”

Txtharga.Text = “42000″

ElseIf kode = “CDR” Then

Txtjudul.Text = “Corel Draw”

Txtpengarang.Text = “Siti Nur Khotimah”

Txtharga.Text = “53000″

ElseIf kode = “RPL” Then

Txtjudul.Text = “Rekayasa Perngkat Lunak”

Txtpengarang.Text = “Winda Erlianti”

Txtharga.Text = “83000″

End If

kode = Mid(Txtkode.Text, 8, 1)

If kode = “A” Then

Txtpenerbit.Text = “Andi Offest Yogyakarta”

ElseIf kode = “I” Then

Txtpenerbit.Text = “Indah Surabaya”

ElseIf kode = “S” Then

Txtpenerbit.Text = “Salemba Empat”

ElseIf kode = “E” Then

Txtpenerbit.Text = “Elek Media Kompotindo”

ElseIf kode = “M” Then

Txtpenerbit.Text = “Maxicom”

End If

Txttahun.Text = “20″ & Mid(Txtkode.Text, 5, 2)

End If

End Sub

Advertisements

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