TUGAS DATABASE 1
Private Sub Cmdbatal_Click()
Textnidn.SetFocus
Textnidn.Text = “”
Textnama.Text = “”
cbogol.Text = “”
Textgajip.Text = “”
Texttunjangan.Text = “”
Textpajak.Text = “”
Texttotal.Text = “”
End Sub
Private Sub Cmdkeluar_Click()
Form2.Show
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
Private Sub cmdlagi_Click()
Textnidn.SetFocus
Textnidn.Text = “”
Textnama.Text = “”
cbogol.Text = “”
Textgajip.Text = “”
Texttunjangan.Text = “”
Textpajak.Text = “”
Texttotal.Text = “”
End Sub
Private Sub cbogol_Click()
Dim gajip, pajak, tunjangan, total As Variant
Select Case cbogol.Text
Case “I”
gajip = 1500000
tunjangan = 150000
Case “II”
gajip = 2000000
tunjangan = 200000
Case “III”
gajip = 2500000
tunjangan = 250000
Case “IV”
gajip = 3000000
tunjangan = 300000
Case Else
gajip = 0
tunjangan = 0
End Select
total = gajip + tunjangan
pajak = total * 0.1
Textgajip.Text = gajip
Texttunjangan.Text = tunjangan
Textpajak.Text = pajak
Texttotal.Text = total – pajak
End Sub
Private Sub Command1_Click()
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Data1.Recordset.Delete
End Sub
Private Sub Command3_Click()
Data1.Recordset.addnew
Textnidn.SetFocus
End Sub
Private Sub Form_Load()
cbogol.AddItem “I”
cbogol.AddItem “II”
cbogol.AddItem “III”
cbogol.AddItem “IV”
End Sub
Private Sub Textnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnama.SetFocus
End If
End Sub
TUGAS DATABASE 2
Private Sub cmdbatal_Click()
Textnama = “”
Textnpm = “”
Textjur = “”
Textps = “”
Texttm = “”
Textnu = “”
End Sub
Private Sub cmdlagi_Click()
Textnama = “”
Textnpm = “”
Textjur = “”
Textps = “”
Texttm = “”
Textnu = “”
End Sub
Private Sub Cmdproses_Click()
Dim jr As String
Dim ps As String
Dim A As String
A = Mid(Textnpm, 3, 1)
If A = 1 Then
jr = “sistem informasi”
ElseIf A = 2 Then
jr = “teknik informatika”
ElseIf A = 3 Then
jr = “menejemen informatika”
ElseIf A = 4 Then
jr = “komputer akuntansi”
End If
Textjur = jr
A = Mid(Textnpm, 4, 2)
If A = “01” Then
ps = “strata 1”
ElseIf A = “02” Then
ps = “diploma 4”
ElseIf A = “03” Then
ps = “diploma 3”
ElseIf A = “04” Then
ps = “diploma 2”
End If
Textps = ps
Texttm = “20” & Left(Textnpm, 2)
Textnu = Right(Textnpm, 3)
End Sub
Private Sub Command1_Click()
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Data1.Recordset.Delete
End Sub
Private Sub Command3_Click()
Data1.Recordset.AddNew
Textnama.SetFocus
End Sub
Private Sub Command4_Click()
Form2.Show
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
TUGAS DATABASE 3
Private Sub cmdbatal_Click()
Textnama.SetFocus
Textnama = “”
Textnpm = “”
Textjurusan = “”
Textps = “”
Texttm = “”
Textnu = “”
End Sub
Private Sub Cmdkeluar_Click()
Form2.Show
End Sub
Private Sub cmdlagi_Click()
Textnama.SetFocus
Textnama = “”
Textnpm = “”
Textjurusan = “”
Textps = “”
Texttm = “”
Textnu = “”
End Sub
Private Sub Cmdproses_Click()
Dim M As String
Texttm = “20” & Left(Textnpm, 2)
M = Mid(Textnpm, 3, 3)
If M = “100” Then
Textjurusan = “sistem informasi”
Textps = “strata 1”
ElseIf M = “200” Then
Textjurusan = “manajemen informatika”
Textps = “diploma 3”
ElseIf M = “300” Then
Textjurusan = “teknik informatika”
Textps = “diploma 4”
ElseIf M = “400” Then
Textjurusan = “komputer akutansi”
Textps = “diploma 2”
End If
Textnu = Right(Textnpm, 3)
End Sub
Private Sub Command1_Click()
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Data1.Recordset.AddNew
Textnama.SetFocus
End Sub
Private Sub Command3_Click()
Data1.Recordset.Delete
End Sub
Private Sub Textnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnpm.SetFocus
End If
End Sub
Private Sub Textnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnpm.SetFocus
End If
End Sub
TUGAS DATABASE 4
Private Sub Cbocode_Click()
Dim merk, hs As String
Select Case Cbocode
Case “MC965”
merk = “Apple MacBook Air MC965”
hs = “12800000”
Case “MC966”
merk = “Apple MacBook Air MC966”
hs = “15800000”
Case ” MC968″
merk = “Apple MacBook Air MC968”
hs = “9900000”
Case ” MC969″
merk = “Apple MacBook Air MC969”
hs = “11900000”
Case “MC700”
merk = “Apple MacBook Pro MC700”
hs = “10800000”
Case “MC721”
merk = “Apple MacBook Pro MC721”
hs = “15900000”
Case “MC723”
merk = “Apple MacBook Pro MC723”
hs = “19300000”
Case “MC724”
merk = “Apple MacBook Pro MC724”
hs = “13700000”
Case “MC311”
merk = “Apple MacBook Pro MC311”
hs = “24200000”
Case “MC313”
merk = “Apple MacBook Pro MC313”
hs = “11900000”
Case “MC314”
merk = “Apple MacBook Pro MC314”
hs = “14700000”
Case “MC318”
merk = “Apple MacBook Pro MC318”
hs = “17600000”
Case “MC322”
merk = “Apple MacBook Pro MC322”
hs = “21300000”
Case ” MC965″
merk = “Apple MacBook Air MC965”
hs = “12800000”
Case “MC966 ”
merk = “Apple MacBook Air MC966”
hs = “15800000 ”
End Select
Textmerk = merk
Texths = hs
Textjj.SetFocus
End Sub
Private Sub cmdhitung_Click()
Cbocode.SetFocus
Cbocode = “”
Textmerk = “”
Texths = “”
Textjj = “”
Texthp = “”
Textdis = “”
Texttotal = “”
End Sub
Private Sub cmdkeluar_Click()
Form2.Show
End Sub
Private Sub cmdproses_Click()
Texthp = Val(Textjj) * Val(Texths)
If Val(Texthp) > 140000000 Then
Textdis = Val(Texthp) * 15 / 100
ElseIf Val(Texthp) > 135000000 Then
Textdis = Val(Texthp) * 10 / 100
ElseIf Val(Texthp) > 130000000 Then
Textdis = Val(Texthp) * 5 / 100
ElseIf Val(Texthp) > 125000000 Then
Textdis = Val(Texthp) * 2 / 100
End If
Texttotal = Val(Texthp) – Val(txtdis)
End Sub
Private Sub Command1_Click()
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Data1.Recordset.Delete
End Sub
Private Sub Command3_Click()
Data1.Recordset.AddNew
Cbocode.SetFocus
End Sub
Private Sub Form_Load()
Cbocode.AddItem “MC965”
Cbocode.AddItem “MC966”
Cbocode.AddItem “MC968”
Cbocode.AddItem “MC969”
Cbocode.AddItem “MC700”
Cbocode.AddItem “MC721”
Cbocode.AddItem “MC723”
Cbocode.AddItem “MC724”
Cbocode.AddItem “MC311”
Cbocode.AddItem “MC313”
Cbocode.AddItem “MC314”
Cbocode.AddItem “MC318”
Cbocode.AddItem “MC322”
End Sub
Private Sub Textjj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Texthp.SetFocus
End If
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
TUGAS DATABASE 5
Private Sub Cbocode_Click()
Dim jenis, hs As String
Select Case Cbocode
Case “P205”
jenis = “Pentium II 500 Mega Hz”
hs = “1500000”
Case “P308”
jenis = “Pentium III 800 Mega Hz ”
hs = “2100000 ”
Case “P310”
jenis = “pentium III 1.0 Giga Hz”
hs = “3500000 ”
Case “P415”
jenis = “Pentium IV 1.5 Giga Hz”
hs = “4000000 ”
Case “P417”
jenis = “Pentium IV 1.7 Giga Hz ”
hs = “4200000 ”
Case “P419”
jenis = “Pentium IV 1.9 Giga Hz”
hs = “5500000 ”
End Select
Textjk = jenis
Texths = hs
Textjj.SetFocus
End Sub
Private Sub Cmdkeluar_Click()
Form2.Show
End Sub
Private Sub Cmdhl_Click()
Cbocode.SetFocus
Cbocode = “”
Textjk = “”
Texths = “”
Textjj = “”
Texthp = “”
Textdis = “”
Texthb = “”
End Sub
Private Sub Cmdproses_Click()
Texthp = Val(Textjj) * Val(Texths)
If Val(Texthp) > “30000000” Then
Textdis = Val(Texthp) * 15 / 100
ElseIf Val(Texthp) > “25000000” Then
Textdis = Val(Texthp) * 10 / 100
ElseIf Val(Texthp) > “20000000” Then
Textdis = Val(Texthp) * 5 / 100
ElseIf Val(Texthp) > “15000000” Then
Textdis = Val(Texthp) * 2 / 100
End If
Texthb = Val(Texthp) – Val(Textdis)
End Sub
Private Sub Command1_Click()
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Data1.Recordset.addnew
Cbocode.SetFocus
End Sub
Private Sub Command3_Click()
Data1.Recordset.Delete
End Sub
Private Sub Form_Activate()
Cbocode.SetFocus
Cbocode = “”
Textjk = “”
Texths = “”
Textjj = “”
Texthp = “”
Textdis = “”
Texthb = “”
End Sub
Private Sub Form_Load()
Cbocode.AddItem “P205”
Cbocode.AddItem “P308”
Cbocode.AddItem “P310”
Cbocode.AddItem “P415”
Cbocode.AddItem “P417”
Cbocode.AddItem “P419”
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub