Aside 7 Mar

Image
Private Sub Cmdbaru_Click()
Data1.Recordset.AddNew
txtnm.SetFocus
End Sub

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

Private Sub Cmdkeluar_Click()
Unload Me

End Sub

Private Sub Cmdproses_Click()
Dim jr, ps, s As String
txttm.Text = “20” & Left(txtnpm.Text, 2)
s = Mid(txtnpm.Text, 3, 1)
If s = “1” Then
jr = “sistem informasi”
ElseIf s = “2” Then
jr = “manajemen informatika”
ElseIf s = “3” Then
jr = “tehnik informatika”
ElseIf s = “4” Then
jr = “komputer akutansi”
End If
txtjur.Text = jr
txtps.Text = Mid(txtnpm.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 dua”
txtps.Text = ps
End If
txturut.Text = Right(txtnpm.Text, 3)
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Aside 7 Mar

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

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

Private Sub Cmdkeluar_Click()
Unload Me

End Sub

Private Sub Cmdproses_Click()
Dim jr, ps, s As String
txttm.Text = “20” & Left(txtnpm.Text, 2)
s = Mid(txtnpm.Text, 3, 1)
If s = “1” Then
jr = “sistem informasi”
ElseIf s = “2” Then
jr = “manajemen informatika”
ElseIf s = “3” Then
jr = “tehnik informatika”
ElseIf s = “4” Then
jr = “komputer akutansi”
End If
txtjur.Text = jr
txtps.Text = Mid(txtnpm.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 dua”
txtps.Text = ps
End If
txturut.Text = Right(txtnpm.Text, 3)
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Aside 25 Jan

ImagePrivate Sub Cmdbatal_Click()
Txtnm.SetFocus
Txtnm.Text = “”
txtjur.Text = “”
txtps.Text = “”
txtthn.Text = “”
Txturut.Text = “”

End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
Txtnm.SetFocus
Txtnm.Text = “”
txtjur.Text = “”
txtps.Text = “”
txtthn.Text = “”
Txturut.Text = “”

End Sub

Private Sub Cmdproses_Click()
Dim s, ps, jur As String
txtthn.Text = “20” & Left(Txtnpm.Text, 2)
s = Mid(Txtnpm.Text, 3, 1)
If s = “1” Then
txtjur.Text = “sistem informasi”
If s = “2” Then
txtjur.Text = “manajemen informatika”
If s = “3” Then
txtjur.Text = “tehnik informatika”
If s = “4” Then
txtjur.Text = “master komputer”
End If
s = Mid(Textnpm.Text, 4, 2)
If s = “01” Then
ps = “strata satu”
If s = “02” Then
ps = “diploma empat”
If s = “03” Then
ps = “diploma tiga”
If s = “04” Then
ps = “diploma satu”
End If
txtjur.Text = jurusan
txtps.Text = ps
Txturut.Text = Right(Txtnpm.Text, 3)

End Sub
Private Sub Txtnm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnpm.SetFocus
End If
End Sub

Tugas Visual Basic

25 Jan

ImagePrivate Sub Chkbold_Click()
If Chkbold.Value = 1 Then
Lblteks.FontBold = True
Else
Lblteks.FontBold = False
End If
End Sub

Private Sub Chkitalic_Click()
If Chkitalic.Value = 1 Then
Lblteks.FontItalic = True
Else
Lblteks.FontItalic = False
End If
End Sub

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

Private Sub chkunder_Click()
If chkunder.Value = 1 Then
Lblteks.FontUnderline = True
Else
Lblteks.FontUnderline = False
End If
End Sub

Private Sub Cmdexit_Click()
Unload Me
End Sub

Private Sub OptBlue_Click()
Lblteks.ForeColor = vbBlue

End Sub

Private Sub OptGreen_Click()
Lblteks.ForeColor = vbGreen

End Sub

Private Sub OptRed_Click()
Lblteks.ForeColor = vbRed

End Sub

Private Sub OptYellow_Click()
Lblteks.ForeColor = vbYellow

End Sub
ImagePrivate Sub Cbonpm_Click()
Dim nama, jurusan, hm As String
Select Case Cbonpm.Text
Case “12101154”
nama = “Tri Andani”
jurusan = “Sistem Informasi”
Case “12202165”
nama = “dewi lestari”
jurusan = “manajemen informatika”
Case “12303122”
nama = “muhammad hadi”
jurusan = “tehnik informatika”
End Select
Txtnm.Text = nama
Txtjrsn.Text = jurusan
Txtquis.SetFocus
End Sub

Private Sub cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm.Text = “”
Txtnm.Text = “”
Txtjrsn.Text = “”
Txtquis.Text = “”
Txttugas.Text = “”
Txtuts.Text = “”
Txtuas.Text = “”
Txtna.Text = “”
Txthm.Text = “”

End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim na As Integer
Dim hm As String
quis = Val(Txtquis.Text)
tugas = Val(Txttugas.Text)
uts = Val(Txtuts.Text)
uas = Val(Txtuas.Text)
na = (quis + tugas + uts + uas) / 4
Txtna.Text = na
Select Case Txtna.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
Txthm.Text = hm
End Sub
Private Sub Form_Load()
Cbonpm.AddItem “12101154”
Cbonpm.AddItem “12202165”
Cbonpm.AddItem “12303122”
End Sub

Private Sub Txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttugas.SetFocus
End If
End Sub

Private Sub Txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuts.SetFocus
End If
End Sub
Private Sub Txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuas.SetFocus
End If
End Sub
Image

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

ImagePrivate 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

Image

Private Sub Check1_Click()
Label2.FontBold = Check1.Value
End Sub

Private Sub Check2_Click()
Label2.FontItalic = Check2.Value
End Sub

Private Sub Command1_Click()
Label2.Caption = Text1.Text
End Sub

Private Sub Command2_Click()
End
End Sub

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

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

Private Sub Text1_Change()

End Sub

Aside 18 Jan

Image

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

Aside 18 Jan

ImagePrivate 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

Aside 18 Jan

ImagePrivate 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