Tugas 4

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

Gambar

Private Sub Cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbogolongan.Text
Case “I”
gapok = 1500000
tunjangan = 150000
Case “II”
gapok = 2000000
tunjangan = 200000
Case “III”
gapok = 2500000
tunjangan = 250000
Case “IV”
gapok = 3000000
tunjangan = 300000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
Txtgapok.Text = gapok
txttunjangan.Text = tunjangan
txtpajak.Text = pajak
txttotal.Text = total – pajak
End Sub

Private Sub Cmdbatal_Click()
Txtnidn.SetFocus
Txtnidn.Text = “”
txtnama.Text = “”
txtgolongan.Text = “”
Txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”

End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnidn.SetFocus
Txtnidn.Text = “”
txtnama.Text = “”
txtgolongan.Text = “”
Txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”

End Sub

Private Sub Form_Load()
Cbogolongan.AddItem “I”
Cbogolongan.AddItem “II”
Cbogolongan.AddItem “III”
Cbogolongan.AddItem “IV”

End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Cbogolongan.SetFocus
End If
End Sub

Private Sub Txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub

BUKU BARU

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 = “indahnya dunia”
ElseIf s = “2” Then
jb = “cahaya ilahi”
ElseIf s = “3” Then
jb = “sistem pengantar komputer”
End If
Text2.Text = jb
s = Mid(Text1.Text, 4, 2)
If s = “01” Then
peng = “HIDAYATUD DINYAH”
ElseIf s = “02” Then
peng = “SYUKUR SALIM”
ElseIf s = “03” Then
peng = “IKHSANIYAH”
End If
s = Mid(Text1.Text, 5, 2)
If s = “11” Then
pnrbt = “kompas candika”
ElseIf s = “12” Then
pnrbt = “raharja com”
ElseIf s = “13” Then
pnrbt = “maya colekword”
End If
s = Right(Text1.Text, 2)
If s = “55” Then
hrg = 25000
ElseIf s = “56” Then
hrg = 30000
ElseIf s = “47” Then
hrg = 35000
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 HURUF MUTU

Gambar

Private Sub Combo1_Click()
Dim nama, jurusan, HM As String
Select Case Combo1.Text
Case “12100145”
nama = “M.MIFTAH”
jurusan = “Sistem Informasi”
Case “12100146”
nama = “HIDAYATUD DINIYAH”
jurusan = “Diploma Empat”
Case “12100147”
nama = “FAHRUL MUHIJAR”
jurusan = “Diploma Tiga”
Case “12100148”
nama = “M FUAD HASYIM”
jurusan = “Diploma Dua”
Case “12100149”
nama = “HARIS PURBIANTO”
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 “12100145”
Combo1.AddItem “12100146”
Combo1.AddItem “12100147”
Combo1.AddItem “12100148”
Combo1.AddItem “12100149”
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

TUGAS PT.PULANGPETANG SETIAP HARI

Gambar

Private Sub CmdBatal_Click()
TxtNama.SetFocus
TxtGolongan = “”
TxtKode = “”
TxtStatus = “”
TxtTahun = “”
TxtJabatan = “”
TxtBagian = “”
TxtGaji = “”
TxtTunjangan = “”
TxtGajitotal = “”
TxtNama = “”
TxtNIK = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
TxtNama.SetFocus
TxtGolongan = “”
TxtKode = “”
TxtStatus = “”
TxtTahun = “”
TxtJabatan = “”
TxtBagian = “”
TxtGaji = “”
TxtTunjangan = “”
TxtGajitotal = “”
TxtNama = “”
TxtNIK = “”
End Sub

Private Sub CmdPROSES_Click()
Dim H, GOLONGAN, KODESTATUS, STATUS, JABATAN, BAGIAN, GAJIPOKOK, TUNJANGAN, TOTALGAJI, asstring
TxtTahun.Text = “” & Left(TxtNIK.Text, 4)
H = Mid(TxtNIK.Text, 5, 1)
If H = “A” Then
GOLONGAN = “A”
ElseIf H = “B” Then
GOLONGAN = “B”
ElseIf H = “C” Then
GOLONGAN = “C”
End If
TxtGolongan.Text = GOLONGAN
H = Mid(TxtNIK.Text, 5, 1)
If H = “A” Then
JABATAN = “Manajer”
ElseIf H = “B” Then
JABATAN = “Ka. Seksi”
ElseIf H = “C” Then
JABATAN = “Staff”
End If
TxtJabatan.Text = JABATAN
H = Mid(TxtNIK.Text, 5, 1)
If H = “A” Then
GAJIPOKOK = “4000000”
ElseIf H = “B” Then
GAJIPOKOK = “3500000”
ElseIf H = “C” Then
GAJIPOKOK = “3000000”
End If
TxtGaji.Text = GAJIPOKOK
H = Mid(TxtNIK.Text, 5, 1)
If H = “A” Then
TUNJANGAN = “1025000”
ElseIf H = “B” Then
TUNJANGAN = “975000”
ElseIf H = “C” Then
TUNJANGAN = “925000”
End If
TxtTunjangan.Text = TUNJANGAN
H = Mid(TxtNIK.Text, 7, 1)
If H = “S” Then
KODESTATUS = “S”
ElseIf H = “M” Then
KODESTATUS = “M”
ElseIf H = “J” Then
KODESTATUS = “J”
ElseIf H = “D” Then
KODESTATUS = “D”
End If
TxtKode.Text = KODESTATUS
H = Mid(TxtNIK.Text, 7, 1)
If H = “S” Then
STATUS = “Single”
ElseIf H = “M” Then
STATUS = “Menikah”
ElseIf H = “J” Then
STATUS = “Janda”
ElseIf H = “D” Then
STATUS = “Duda”
End If
TxtStatus.Text = STATUS
H = Right(TxtNIK.Text, 3)
If H = “KEU” Then
BAGIAN = “Accounting”
ElseIf H = “ADM” Then
BAGIAN = “Administrasi”
ElseIf H = “SDM” Then
BAGIAN = “General Affair”
ElseIf H = “EDP” Then
BAGIAN = “IP Unit”
ElseIf H = “SPM” Then
BAGIAN = “Security”
End If
TxtBagian.Text = BAGIAN
TxtGajitotal.Text = Val(TxtGaji.Text) + Val(TxtTunjangan.Text)

End Sub

Private Sub TxtNama_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
TxtNIK.SetFocus
End If

End Sub

PROPERTY TEST_HIDAYATUD DINIYAH

Gambar

Private Sub ChkMiring_Click()
Label2.FontItalic = ChkMiring.Value
End Sub

Private Sub ChkTebal_Click()
Label2.FontBold = ChkTebal.Value
End Sub

Private Sub CmdOke_Click()
Label2.Caption = TxtNama.Text
End Sub

Private Sub CmdSelesai_Click()
Unload Me
End Sub

Private Sub OptBlue_Click()
Label2.ForeColor = vbBlue
End Sub

Private Sub OptRed_Click()
Label2.ForeColor = vbRed
End Sub

DATA BUKU STMIK PRINGSEWU

Gambar

Private Sub CmdBATAL_Click()
TxtKode.SetFocus
TxtKode.Text = “”
TxtJB.Text = “”
TxtPEM.Text = “”
TxtTT.Text = “”
TxtPEN.Text = “”
TxtHrg.Text = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
TxtKode.SetFocus
TxtKode.Text = “”
TxtJB.Text = “”
TxtPEM.Text = “”
TxtTT.Text = “”
TxtPEN.Text = “”
TxtHrg.Text = “”
End Sub

Private Sub CmdPROSES_Click()
Dim H As String
TxtTT.Text = “20” & Right(TxtKode.Text, 2)
H = Mid(TxtKode.Text, 3, 3)
If H = “SIM” Then
TxtJB.Text = “SISTEM INFORMASI MANAJEMEN”
ElseIf H = “EDP” Then
TxtJB.Text = “ELEKTRONIK DATA PROCESSING”
ElseIf H = “MJN” Then
TxtJB.Text = “MANAJEMEN”
ElseIf H = “CDR” Then
TxtJUDUL.Text = “CORELDRAW”
ElseIf H = “RPL” Then
TxtJB.Text = “REKAYASA PERANGKAT LUNAK”
End If
H = Left(TxtKode.Text, 1)
If H = “A” Then
TxtPEN.Text = “ANDI OFSET YOGYAKARTA”
ElseIf H = “I” Then
TxtPEN.Text = “INDAH SURABAYA”
ElseIf H = “S” Then
TxtPEN.Text = “SALEMBA”
ElseIf H = “E” Then
TxtPENText = “ELEK MEDIA KOMPUTION”
ElseIf H = “M” Then
TxtPEN.Text = “MAXICOM”
End If
H = Mid(TxtKode.Text, 3, 3)
If H = “SIM” Then
TxtPEM.Text = “ANDRA SETIAWAN”
ElseIf H = “EDP” Then
TxtPEM.Text = “DESI ISTIQOMAH”
ElseIf H = “MJN” Then
TxtPENGARANG.Text = “SANDI FITRAJAYA”
ElseIf H = “CDR” Then
TxtPEM.Text = “TRI INDAH SARI”
ElseIf H = “RPL” Then
TxtPEM.Text = “ERNITA”
End If
H = Mid(TxtKode.Text, 3, 3)
If H = “SIM” Then
TxtHrg.Text = “83000”
ElseIf H = “EDP” Then
TxtHrg.Text = “57000”
ElseIf H = “MJN” Then
TxtHrg.Text = “42000”
ElseIf H = “CDR” Then
TxtHrg.Text = “62000”
ElseIf H = “RPL” Then
TxtHrg.Text = “75900”
End If
End Sub

Nama Mahasiswa STMIK Pringsewu

Gambar
Private Sub CmdBatal_Click()
TxtNama.SetFocus
TxtNama.Text = “”
TxtNPM.Text = “”
TxtJR.Text = “”
TxtPS.Text = “”
TxtTA.Text = “”
TxtNU.Text = “”

End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
TxtNama.SetFocus
TxtNama.Text = “”
TxtNPM.Text = “”
TxtJR.Text = “”
TxtPS.Text = “”
TxtTA.Text = “”
TxtNU.Text = “”
End Sub

Private Sub CmdProses_Click()
Dim H As Integer
TxtTA.Text = “20” & Left(TxtNPM, 2)
H = Mid(TxtNPM.Text, 3, 1)
If H = “1” Then
TxtJR.Text = “Sistem Informasi”
ElseIf H = “2” Then
TxtJR = “Manajemen Informatika”
ElseIf H = “3” Then
TxtJR.Text = “Teknik Informatika”
ElseIf H = “4” Then
TxtJR.Text = “Komputer Akuntansi”
End If
H = Mid(TxtNPM.Text, 4, 2)
If H = “01” Then
TxtPS.Text = “Strata Satu”
ElseIf H = “02” Then
TxtPS.Text = “Diploma Empat”
ElseIf H = “03” Then
TxtPS.Text = “Diploma Tiga”
ElseIf H = “04” Then
TxtPS.Text = “Diploma Dua”
End If
TxtNU.Text = Right(TxtNPM, 3)
End Sub

Private Sub TxtNama_Keypress(keyascii As Integer)
If keyascii = 13 Then
TxtNPM.SetFocus
End If
End Sub

FONT COLOR & FONT STYLE

 

Gambar

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

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

Private Sub Chkstrike_Click()
If Chkunder.Value = 1 Then
LblText.FontStrikethru = True
Else
LblText.FontStrikethru = False
End If
End Sub

Private Sub Chkunder_Click()
If Chkunder.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()
LblText.ForeColor = vbBlue
End Sub

Private Sub OptGreen_Click()
LblText.ForeColor = vbGreen
End Sub

Private Sub OptRed_Click()
LblText.ForeColor = vbRed
End Sub

Private Sub Optyellow_Click()
LblText.ForeColor = vbYellow
End Sub

Tugas Visual Basic 1.

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

Gambar

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

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

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

Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

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

Private Sub Command6_Click()
Unload Me
End Sub

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

Gambar

Private Sub Command1_Click()
Text7.Text = Val((Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 4
End Sub

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

Private Sub Command3_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
Text7 = “”
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

Private Sub Text2_keypress(keyascii As Integer)
If keyascii = 13 Then
Text3.SetFocus
End If
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

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.Text = Val(Text1.Text) * 0.1
End If
End Sub