Tugas Visual Basic#1 Tugas Ke 4

Awalan Postingan

Assalamu’alaikum Wr. Wb.
Huh lagi lagi Tugas, Tugas Terus.. hehehe
Artikel Ini diposting guna untuk memenuhi Tugas Mata Kuliah VB#1 Tugas ke 4.
ada 4 Program langsung aja yah Nie dia…😀

Nama : Adi Setiawan
NPM : 12100535
Kelas : Twitter12
Mata Kuliah : Visual Basic#1

Program 1

Data Mahasiswa Adi Setiawan

Source Code Simak Dibawah ini :

Private Sub Command1_Click()
Dim S As String
Text5.Text = "20" & Left(Text2.Text, 2)
S = Mid(Text2.Text, 3, 1)
If S = "1" Then
Text3.Text = "Sistem Informasi"
ElseIf S = "2" Then
Text3.Text = "Manajemen Informatika"
ElseIf S = "3" Then
Text3.Text = "Tehnik Informatika"
ElseIf S = "4" Then
Text3.Text = "Manajemen & Komp. Akuntansi"
End If
S = Mid(Text2.Text, 4, 2)
If S = "01" Then
Text4.Text = "Strata Satu"
ElseIf S = "02" Then
Text4.Text = "Diploma Tiga"
ElseIf S = "03" Then
Text4.Text = "Diploma Empat"
ElseIf S = "04" Then
Text4.Text = "Diploma Dua"
End If
Text6.Text = Right(Text2.Text, 3)
End Sub

Private Sub Text1_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub

Private Sub Command4_Click()
End
End Sub

Program Ke 2

Gambar 2

Source Code:

 Private Sub Command1_Click()
 Dim S As String
 S = Mid(Combo1.Text, 3, 3)
 If S = "SIM" Then
 TXTADI1.Text = "Sistem Informasi Manajemen"
 TXTADI2.Text = "Yati Nur Oktavia"
 TXTADI5.Text = 75900
 ElseIf S = "EDP" Then
 TXTADI1.Text = "Elektronik Data Processing"
 TXTADI2.Text = "Imam Tarmizi"
 TXTADI5.Text = 62000
 ElseIf S = "MNJ" Then
 TXTADI1.Text = "Manajemen"
 TXTADI2.Text = "Valentina Mariana Adiwiyanti"
 TXTADI5.Text = 42000
 ElseIf S = "CDR" Then
 TXTADI1.Text = "Corel Draw"
 TXTADI2.Text = "Riyan Suhandi"
 TXTADI5.Text = 53000
 ElseIf S = "RLP" Then
 TXTADI1.Text = "Rekayasa Perangkat Lunak"
 TXTADI2.Text = "Sinta Umpu Singa"
 TXTADI5.Text = 83000
 End If
 S = Left(Combo1.Text, 1)
 If S = "A" Then
 TXTADI4.Text = "Andi Offset Yogyakarta"
 ElseIf S = "I" Then
 TXTADI4.Text = "Indah Surabaya"
 ElseIf S = "S" Then
 TXTADI4.Text = "Salemba Empat"
 ElseIf S = "E" Then
 TXTADI4.Text = "Elek Media Komputindo"
 ElseIf S = "M" Then
 TXTADI4.Text = "Maxicom"
 End If

 S = Right(Combo1.Text, 2)
 If S = "01" Then
 TXTADI3.Text = "2001"
 ElseIf S = "02" Then
 TXTADI3.Text = "2002"
 ElseIf S = "03" Then
 TXTADI3.Text = "2003"
 ElseIf S = "04" Then
 TXTADI3.Text = "2004"
 ElseIf S = "05" Then
 TXTADI3.Text = "2005"
 End If
 End Sub

 Private Sub Command2_Click()
 Combo1.Text = ""
 TXTADI1.Text = ""
 TXTADI2.Text = ""
 TXTADI3.Text = ""
 TXTADI4.Text = ""
 TXTADI5.Text = ""
 TXTADI1.SetFocus
 End Sub

 Private Sub Command3_Click()
 Combo1.Text = ""
 TXTADI1.Text = ""
 TXTADI2.Text = ""
 TXTADI3.Text = ""
 TXTADI4.Text = ""
 TXTADI5.Text = ""
 TXTADI1.SetFocus
 End Sub

 Private Sub Command4_Click()
 End
 End Sub

 Private Sub Form_Load()
 Combo1.AddItem "A-SIM-01"
 Combo1.AddItem "I-EDP-02"
 Combo1.AddItem "S-MNJ-03"
 Combo1.AddItem "E-CDR-04"
 Combo1.AddItem "M-RLP-05"
 End Sub

Program Ke 3
Gambar Baru

Source Code :

Private Sub Command1_Click()
Dim S As String
S = Mid(Text1.Text, 1, 3)
If S = "SIM" Then
TXTADI1.Text = "Sistem Informasi Manajemen"
TXTADI2.Text = "Fadiya Ulfa"
TXTADI5.Text = 75900
ElseIf S = "EDP" Then
TXTADI1.Text = "Elektronik Data Processing"
TXTADI2.Text = "Nurul Agustina"
TXTADI5.Text = 62000
ElseIf S = "MNJ" Then
TXTADI1.Text = "Manajemen"
TXTADI2.Text = "Rian Hidayat"
TXTADI5.Text = 42000
ElseIf S = "CDR" Then
TXTADI1.Text = "Corel Draw"
TXTADI2.Text = "Siti Nur Khotimah"
TXTADI5.Text = 53000
ElseIf S = "RPL" Then
TXTADI1.Text = "Rekayasa Perangkat Lunak"
TXTADI2.Text = "Winda Erlianti"
TXTADI5.Text = 83000
End If
S = Right(Text1.Text, 1)
If S = "A" Then
TXTADI4.Text = "Andi Offset Yogyakarta"
ElseIf S = "I" Then
TXTADI4.Text = "Indah Surabaya"
ElseIf S = "S" Then
TXTADI4.Text = "Salemba Empat"
ElseIf S = "E" Then
TXTADI4.Text = "Elek Media Komputindo"
ElseIf S = "M" Then
TXTADI4.Text = "Maxicom"
End If

S = Mid(Text1.Text, 5, 2)
If S = "09" Then
TXTADI3.Text = "2009"
ElseIf S = "10" Then
TXTADI3.Text = "2010"
ElseIf S = "11" Then
TXTADI3.Text = "2011"
ElseIf S = "12" Then
TXTADI3.Text = "2012"
ElseIf S = "13" Then
TXTADI3.Text = "2013"
End If
End Sub

Private Sub Command2_Click()
Combo1.Text = ""
TXTADI1.Text = ""
TXTADI2.Text = ""
TXTADI3.Text = ""
TXTADI4.Text = ""
TXTADI5.Text = ""
TXTADI1.SetFocus
End Sub

Private Sub Command3_Click()
TXTADI1.Text = ""
TXTADI2.Text = ""
TXTADI3.Text = ""
TXTADI4.Text = ""
TXTADI5.Text = ""
TXTADI1.SetFocus
End Sub

Private Sub Command4_Click()
End
End Sub

Program Ke 4

Gambar 4

Source Code :

Private Sub Command1_Click()
Dim S As String
S = Mid(txtAdi11.Text, 1, 4)
txtAdi4.Text = S

S = Mid(txtAdi11.Text, 5, 1)
If S = "A" Then
txtAdi1.Text = "A"
txtAdi5.Text = "Manajer"
txtAdi7.Text = "4000000"
txtAdi8.Text = "1025000"
txtAdi9.Text = (Val(txtAdi7.Text) + Val(txtAdi8.Text))
ElseIf S = "B" Then
txtAdi1.Text = "B"
txtAdi5.Text = "Ka. Seksi"
txtAdi7.Text = "3500000"
txtAdi8.Text = "975000"
txtAdi9.Text = (Val(txtAdi7.Text) + Val(txtAdi8.Text))
ElseIf S = "C" Then
txtAdi1.Text = "C"
txtAdi5.Text = "Staff"
txtAdi7.Text = "3000000"
txtAdi8.Text = "925000"
txtAdi9.Text = (Val(txtAdi7.Text) + Val(txtAdi8.Text))
End If

S = Mid(txtAdi11.Text, 7, 1)
If S = "S" Then
txtAdi2.Text = "S"
txtAdi3.Text = "Single"
ElseIf S = "M" Then
txtAdi2.Text = "M"
txtAdi3.Text = "Menikah"
ElseIf S = "J" Then
txtAdi2.Text = "J"
txtAdi3.Text = "Janda"
ElseIf S = "D" Then
txtAdi2.Text = "D"
txtAdi3.Text = "Duda"
End If
S = Right(txtAdi11.Text, 3)
If S = "KEU" Then
txtAdi6.Text = "Accounting"
ElseIf S = "ADM" Then
txtAdi6.Text = "Administrasi"
ElseIf S = "SDM" Then
txtAdi6.Text = "General Affair"
ElseIf S = "EDP" Then
txtAdi6.Text = "IT Unit"
ElseIf S = "SPM" Then
txtAdi6.Text = "Security"
End If
End Sub

Private Sub Command2_Click()
txtAdi1.Text = ""
txtAdi2.Text = ""
txtAdi3.Text = ""
txtAdi4.Text = ""
txtAdi5.Text = ""
txtAdi6.Text = ""
txtAdi7.Text = ""
txtAdi8.Text = ""
txtAdi9.Text = ""
txtAdi10.Text = ""
txtAdi11.Text = ""
txtAdi10.SetFocus
End Sub

Private Sub Command3_Click()
txtAdi1.Text = ""
txtAdi2.Text = ""
txtAdi3.Text = ""
txtAdi4.Text = ""
txtAdi5.Text = ""
txtAdi6.Text = ""
txtAdi7.Text = ""
txtAdi8.Text = ""
txtAdi9.Text = ""
txtAdi10.Text = ""
txtAdi11.Text = ""
txtAdi10.SetFocus
End Sub

Private Sub Command4_Click()
End
End Sub

Wassalam

One thought on “Tugas Visual Basic#1 Tugas Ke 4

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