Tugas 4

Standard

Gambar

Private Sub Cmdbaru_Click()
Data1.Recordset.AddNew
Textnama.SetFocus
End Sub

Private Sub Cmddelete_Click()
Data1.Recordset.Delete
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim s, ps, jr As String
Texttahun.Text = “20” & Left(Textnpm.Text, 2)
s = Mid(Textnpm.Text, 3, 1)
If s = “1” Then
jr = “sistem informasi”
ElseIf s = “2” Then
jr = “manajemen informatika”
ElseIf s = “3” Then
jr = “teknik informatika”
ElseIf s = “4” Then
jr = “Master komputer”
End If
s = Mid(Textnpm.Text, 4, 2)
If s = “01” Then
ps = “strata satu”
ElseIf s = “02” Then
ps = “Diploma empat”
ElseIf s = “03” Then
ps = “Diploma tiga”
ElseIf s = “04” Then
ps = “Diploma satu”
End If
Textjurusan.Text = jr
Textprody.Text = ps
Texturut.Text = Right(Textnpm.Text, 3)
End Sub

Private Sub Cmdsimpan_Click()
Data1.Recordset.Update
Textnama.SetFocus
End Sub

Private Sub Textnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnpm.SetFocus
End If
End Sub

Huruf Mutu Mahasiswa Stmik Pringsewu

Standard

Gambar

Private Sub Combo1_Click()
Dim nama, jurusan, HM As String
Select Case Combo1.Text
Case “12100162”
nama = “SULIS NAILILMUNA”
jurusan = “Sistem Informasi”
Case “12100163”
nama = “ANITA YULIANI”
jurusan = “Diploma Empat”
Case “12100164”
nama = “MARHATUN KHOTIMAH”
jurusan = “Diploma Tiga”
Case “12100165”
nama = “M FUAD HASYIM”
jurusan = “Diploma Dua”
Case “12100166”
nama = “M. MIFTAHUDIN”
jurusan = “Diploma Satu”
End Select
Text1.Text = nama
Text2.Text = jurusan
Text3.SetFocus
End Sub

Private Sub command1_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(Text3.Text)
TUGAS = Val(Text4.Text)
UTS = Val(Text5.Text)
UAS = Val(Text6.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
Text7.Text = NA

Select Case Text7.Text
Case Is > 80
HM = “A”
Case Is > 70
HM = “B”
Case Is > 60
HM = “C”
Case Is > 50
HM = “D”
Case Is < 50
HM = “E”
End Select
Text8.Text = HM
End Sub

Private Sub Command2_Click()
Combo1.SetFocus
Combo1.Text = “”
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Combo1.AddItem “12100162”
Combo1.AddItem “12100163”
Combo1.AddItem “12100164”
Combo1.AddItem “12100165”
Combo1.AddItem “12100166”
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub

PT. Pulang Petang Setiap Hari

Standard

Gambar

Private Sub Command1_Click()
Dim a, GOLONGAN, KODESTATUS, STATUS, JABATAN, BAGIAN, GAJIPOKOK, TUNJANGAN, totalgaji, asstring
Text4.Text = “” & Left(Text11.Text, 4)
a = Mid(Text11.Text, 5, 1)
If a = “A” Then
GOLONGAN = “A”
ElseIf a = “B” Then
GOLONGAN = “B”
ElseIf a = “C” Then
GOLONGAN = “C”
End If
Text1.Text = GOLONGAN
a = Mid(Text11.Text, 5, 1)
If a = “A” Then
JABATAN = “MANAJER”
ElseIf a = “B” Then
JABATAN = “Ka Seksi”
ElseIf a = “C” Then
JABATAN = “Staff”
End If
Text5.Text = JABATAN
a = Mid(Text11.Text, 5, 1)
If a = “A” Then
GAJIPOKOK = “5000000”
ElseIf a = “B” Then
GAJIPOKOK = “3750000”
ElseIf a = “C” Then
GAJIPOKOK = “3250000”
End If
Text7.Text = GAJIPOKOK
a = Mid(Text11.Text, 5, 1)
If a = “A” Then
TUNJANGAN = “1500000”
ElseIf a = “B” Then
TUNJANGAN = “1250000”
ElseIf a = “C” Then
TUNJANGAN = “975000”
End If
Text8.Text = TUNJANGAN
a = Mid(Text11.Text, 7, 1)
If a = “S” Then
KODESTATUS = “S”
ElseIf a = “M” Then
KODESTATUS = “M”
ElseIf a = “J” Then
KODESTATUS = “J”
ElseIf a = “D” Then
KODESTATUS = “D”
End If
Text2.Text = KODESTATUS
a = Mid(Text11.Text, 7, 1)
If a = “S” Then
STATUS = “single”
ElseIf a = “M” Then
STATUS = “menikah”
ElseIf a = “J” Then
STATUS = “janda”
ElseIf a = “D” Then
STATUS = “duda”
End If
Text3.Text = STATUS
a = Right(Text11.Text, 3)
If a = “KEU” Then
BAGIAN = “Accounting”
ElseIf a = “ADM” Then
BAGIAN = “Administrasi”
ElseIf a = “SDM” Then
BAGIAN = “General Affair”
ElseIf a = “EDP” Then
BAGIAN = “IP Unit”
ElseIf a = “SPM” Then
BAGIAN = “Security”
End If
Text6.Text = BAGIAN
Text9.Text = Val(Text7.Text) + Val(Text8.Text)
End Sub
Private Sub Command2_Click()
Text10.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
Text7 = “”
Text8 = “”
Text9 = “”
Text10 = “”
Text11 = “”
End Sub
Private Sub Command3_Click()
Text10.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
Text7 = “”
Text8 = “”
Text9 = “”
Text10 = “”
Text11 = “”
End Sub
Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Text10_keypress(keyascii As Integer)
If keyascii = 13 Then
Text11.SetFocus
End If
End Sub

Menentukan Tahun Masuk Berdasarkan NPM

Standard

Gambar

Private Sub Command1_Click()
Dim s, ps, jr As String
Text5.Text = “20” & Left(Text2.Text, 2)
s = Mid(Text2.Text, 3, 1)
If s = “1” Then
jr = “sistem informasi”
ElseIf s = “2” Then
jr = “manajemen informatika”
ElseIf s = “3” Then
jr = “teknik informatika”
ElseIf s = “4” Then
jr = “Master komputer”
End If
s = Mid(Text2.Text, 4, 2)
If s = “01” Then
ps = “strata satu”
ElseIf s = “02” Then
ps = “Diploma empat”
ElseIf s = “03” Then
ps = “Diploma tiga”
ElseIf s = “04” Then
ps = “Diploma satu”
End If
Text3.Text = jr
Text4.Text = ps
Text6.Text = Right(Text2.Text, 3)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Tgas 2.3 DATA BUKU STMIK PRINGSEWU

Standard

Gambar

Private Sub Command1_Click()
Dim s, jb, peng, penr, hrg As String
Text4.Text = “20” & Left(Text1.Text, 2)
s = Mid(Text1.Text, 3, 1)
If s = “1” Then
jb = “BINTANG KEHIDUPAN”
ElseIf s = “2” Then
jb = “PARU-PARU KOTA”
ElseIf s = “3” Then
jb = “DESAKU”
End If
Text2.Text = jb
s = Mid(Text1.Text, 4, 2)
If s = “01” Then
peng = “SULIS NAILILMUNA STMIK”
ElseIf s = “02” Then
peng = “HERMAN SYAH”
ElseIf s = “03” Then
peng = “HAIKAL”
End If
s = Mid(Text1.Text, 5, 2)
If s = “11” Then
pnrbt = “CAKRAWALA”
ElseIf s = “12” Then
pnrbt = “CAKRAWALA”
ElseIf s = “13” Then
pnrbt = “GRAMEDIA”
End If
s = Right(Text1.Text, 2)
If s = “62” Then
hrg = 40000
ElseIf s = “63” Then
hrg = 55000
ElseIf s = “64” Then
hrg = 75000
End If
Text3.Text = peng
Text5.Text = pnrbt
Text6.Text = hrg
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Tugas Visual Basic 2.1

Standard

Gambar

Private Sub ChkBold_Click()
‘membuat texttebal
If ChkBold.Value = 1 Then
LblText.FontBold = True
Else
LblText.FontBold = False
End If
End Sub

Private Sub ChkItalic_Click()
‘membuat textmiring
If ChkItalic.Value = 1 Then
LblText.FontItalic = True
Else
LblText.FontItalic = False
End If
End Sub

Private Sub ChkStrikethru_Click()
‘membuat textbergaris tengah
If ChkStrikethru.Value = 1 Then
LblText.FontStrikethru = True
Else
LblText.FontStrikethru = False
End If
End Sub

Private Sub ChkUnderline_Click()
‘membuat textbergaris bawah
If ChkUnderline.Value = 1 Then
LblText.FontUnderline = True
Else
LblText.FontUnderline = False
End If
End Sub

Private Sub CmdExit_Click()
Unload Me
End Sub

Private Sub OptBlue_Click()
‘membuat teks berwarna biru
LblText.ForeColor = vbBlue
End Sub

Private Sub OptGreen_Click()
‘membuat teks berwarna hijau
LblText.ForeColor = vbGreen
End Sub

Private Sub OptRed_Click()
‘membuat teks berwarna merah
LblText.ForeColor = vbRed
End Sub

Private Sub OptYellow_Click()
‘membuat teks berwarna kuning
LblText.ForeColor = vbYellow
End Sub

Tugas 1.1 Visual Basic

Standard

Gambar

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub

Tugas 1.4

Standard

Gambar

Private Sub CmdHitung_Click()
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub CmdLagi_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub CmdQiut_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.Text = Val(Text1.Text) * 0.1
End If
End Sub

Tugas 1.3

Standard

Gambar

Private Sub CmdBatal_Click()
TextNPM.SetFocus
TextNPM = “”
TextNama = “”
TextTugas = “”
TextQuis = “”
TextUTS = “”
TextUAS = “”
TextNA = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
TextNPM.SetFocus
TextNPM = “”
TextNama = “”
TextTugas = “”
TextQuis = “”
TextUTS = “”
TextUAS = “”
TextNA = “”
End Sub

Private Sub CmdProses_Click()
TextNA.Text = Val((TextTugas.Text) + Val(TextQuis.Text) + Val(TextUTS.Text) + Val(TextUAS.Text)) / 4
End Sub

Private Sub TextNA_Change()
TextNA.Text = Val((TextTugas.Text) + Val(TextQuis.Text) + Val(TextUTS.Text) + Val(TextUAS.Text)) / 4
End Sub

Private Sub TextNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TextTugas.SetFocus
End If
End Sub

Private Sub TextNpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TextNama.SetFocus
End If
End Sub

Private Sub TextQuis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TextUTS.SetFocus
End If
End Sub

Private Sub TextTugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TextQuis.SetFocus
End If
End Sub

Private Sub TextUTS_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TextUAS.SetFocus
End If
End Sub