Tugas : Database 1 – 9

Tugas 1

Capture

Private Sub Cmdbatal_Click()
kosong
End Sub

Private Sub cmdlagi_Click()
kosong
End Sub

Private Sub Command1_Click()
file1.Recordset.Update
End Sub

Private Sub Command2_Click()
file1.Recordset.AddNew
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub CommandHAPUS_Click()
file1.Recordset.Delete
End Sub

Private Sub Form_load()
Cbmgolongan.AddItem “I”
Cbmgolongan.AddItem “II”
Cbmgolongan.AddItem “III”
Cbmgolongan.AddItem “IV”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub cbmgolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbmgolongan.Text
Case “I”
gapok = 3000000
tunjangan = 200000
Case “II”
gapok = 5000000
tunjangan = 300000
Case “III”
gapok = 7500000
tunjangan = 750000
Case “IV”
gapok = 11000000
tunjangan = 1100000
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

Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = “”
Txtnama.Text = “”
Cbmgolongan.Text = “”
Txtgapok.Text = “”
txttunjangan.Text = “”
Txtpajak.Text = “”
Txttotal.Text = “”
End Sub

Private Sub txtnidn_keypress(keyascii As Integer)
If keyascii = 13 Then
Txtnama.SetFocus
End If
End Sub

 

Tugas 2

Capture

Private Sub Cmdbatal_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnpm.Text = “”
Txtjur.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txturut.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnpm.Text = “”
Txtjur.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txturut.Text = “”
End Sub

Private Sub Cmdproses_Click()
Dim S As String
Txttm.Text = “20” & Left(Txtnpm.Text, 2)
S = Mid(Txtnpm.Text, 3, 1)
If S = “1” Then
Txtjur.Text = “Sistem Informasi”
ElseIf S = “2” Then
Txtjur.Text = “Teknik Informatika”
ElseIf S = “3” Then
Txtjur.Text = “Manajemen Informatika”
ElseIf S = “4” Then
Txtjur.Text = “Komputer Akuntansi”
End If
S = Mid(Txtnpm.Text, 4, 2)
If S = “01” Then
Txtps.Text = “Strata Satu”
ElseIf S = “02” Then
Txtps.Text = “Diploma Empat”
ElseIf S = “03” Then
Txtps.Text = “Diploma Tiga”
ElseIf S = “04” Then
Txtps.Text = “Diploma Dua”
End If
Txturut.Text = Right(Txtnpm.Text, 3)
End Sub

Private Sub Command1_Click()
file1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
file1.Recordset.Update
End Sub

Private Sub Command3_Click()
Form2.Show
End Sub

Private Sub Command4_Click()
file1.Recordset.Delete
End Sub

Private Sub Form_activate()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnpm.Text = “”
Txtjur.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txturut.Text = “”
End Sub

Private Sub Txtnama_Keypress(Keyascii As Integer)
If Keyascii = 13 Then
Txtnpm.SetFocus
End If
End Sub

 

Tugas 3

Capture

Private Sub cbmkode_Click()
Select Case cbmkode.Text
Case Is = “Apple MC956 MacBook Air”
MERK = “Apple MC956 MacBook Air”
HS = “12800000”
Case Is = “Apple MC966 MacBook Air”
MERK = “Apple MC966 MacBook Air”
HS = “15800000”
Case Is = “Apple MC968 MacBook Air”
MERK = “Apple MC968 MacBook Air”
HS = “9900000”
Case Is = “Apple MC969 MacBook Air”
MERK = “Apple MC969 MacBook Air”
HS = “11900000”
Case Is = “Apple MC700 MacBook Pro”
MERK = “Apple MC700 MacBook Pro”
HS = “10800000”
Case Is = “Apple MC721 MacBook Pro”
MERK = “Apple MC721 MacBook Pro”
HS = “15900000”
Case Is = “Apple MC723 MacBook Pro”
MERK = “Apple MC723 MacBook Pro”
HS = “19300000”
Case Is = “Apple MC724 MacBook Pro”
MERK = “Apple MC724 MacBook Pro”
HS = “13700000”
Case Is = “Apple MC711 MacBook Pro”
MERK = “Apple MC711 MacBook Pro”
HS = “24200000”
Case Is = “Apple MC313 MacBook Pro”
MERK = “Apple MC313 MacBook Pro”
HS = “11900000”
Case Is = “Apple MC314 MacBook Pro”
MERK = “Apple MC314 MacBook Pro”
HS = “14700000”
Case Is = “Apple MC318 MacBook Pro”
MERK = “Apple MC318 MacBook Pro”
HS = “17600000”
Case Is = “Apple MC322 MacBook Pro”
MERK = “Apple MC322 MacBook Pro”
HS = “21300000”
Case Is = “Apple MC965 MacBook Air”
MERK = “Apple MC965 MacBook Air”
HS = “12800000”
Case Is = “Apple MC966 MacBook Air”
MERK = “Apple MC966 MacBook Air”
HS = “15800000”
End Select
Txtmerk.Text = MERK
Txths.Text = HS
Txtjj.SetFocus
End Sub

Private Sub cmdadd_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

Private Sub cmdcancel_Click()
cbmkode.SetFocus
cbmkode.Text = “”
Txtmerk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdis.Text = “”
Txttb.Text = “”
End Sub

Private Sub cmddelete_Click()
Data1.Recordset.Delete
Data1.Recordset.MovePrevious
End Sub

Private Sub cmdkeluar_Click()
Form2.Show
End Sub

Private Sub Cmdproses_Click()
Txthp.Text = Val(Txths.Text) * Val(Txtjj.Text)
Select Case Txthp.Text
Case Is > 140000000
discount = Val(Txthp.Text) * 0.15
Case Is > 135000000
discount = Val(Txthp.Text) * 0.1
Case Is > 130000000
discount = Val(Txthp.Text) * 0.05
Case Is > 125000000
discount = Val(Txthp.Text) * 0.02
End Select
Txtdis.Text = discount
Txttb.Text = Val(Txthp.Text) – Val(Txtdis.Text)
End Sub

Private Sub cmdsave_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveNext
End Sub

Private Sub Form_Load()
cbmkode.AddItem “Apple MC956 MacBook Air”
cbmkode.AddItem “Apple MC966 MacBook Air”
cbmkode.AddItem “Apple MC968 MacBook Air”
cbmkode.AddItem “Apple MC969 MacBook Air”
cbmkode.AddItem “Apple MC700 MacBook Pro”
cbmkode.AddItem “Apple MC721 MacBook Pro”
cbmkode.AddItem “Apple MC723 MacBook Pro”
cbmkode.AddItem “Apple MC724 MacBook Pro”
cbmkode.AddItem “Apple MC711 MacBook Pro”
cbmkode.AddItem “Apple MC313 MacBook Pro”
cbmkode.AddItem “Apple MC314 MacBook Pro”
cbmkode.AddItem “Apple MC318 MacBook Pro”
cbmkode.AddItem “Apple MC322 MacBook Pro”
cbmkode.AddItem “Apple MC965 MacBook Air”
cbmkode.AddItem “Apple MC966 MacBook Air”
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form2.Show
End Sub

 

Tugas 4

Capture

Private Sub Cbokode_Click()
Dim kk, jk, hs As String
Select Case CBOKODE.Text
Case “P205”
Txtjk.Text = “Pentium II 500 Mega Hz”
Txths.Text = “1500000”
Case “P308”
Txtjk.Text = “Pentium III 800 Mega Hz”
Txths.Text = “2100000”
Case “P310”
Txtjk.Text = “Pentium III 1.0 Giga Hz”
Txths.Text = “3500000”
Case “P415”
Txtjk.Text = “Pentium IV 1.5 Giga Hz”
Txths.Text = “4000000”
Case “P417”
Txtjk.Text = “Pentium IV 1.7 Giga Hz”
Txths.Text = “4200000”
Case “P419”
Txtjk.Text = “Pentium IV 1.9 Mega Hz”
Txths.Text = “5500000”
End Select
End Sub

Private Sub cmdadd_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

Private Sub cmdcancel_Click()
CBOKODE.SetFocus
CBOKODE.Text = “”
Txtjk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdis.Text = “”
Txttb.Text = “”
End Sub

Private Sub cmddelete_Click()
Data1.Recordset.Delete
Data1.Recordset.MovePrevious
End Sub

Private Sub Cmdproses_Click()
Txthp.Text = Val(Txtjj.Text) * Val(Txths.Text)
If Txthp.Text > 30000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.15
ElseIf Txthp.Text > 25000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.1
ElseIf Txthp.Text > 20000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.5
ElseIf Txthp.Text > 15000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.2
End If
Txttb.Text = Val(Txthp.Text) – Val(Txtdis.Text)
End Sub

Private Sub cmdkeluar_Click()
Form2.Show
End Sub

Private Sub cmdsave_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveNext
End Sub

Private Sub Form_Load()
CBOKODE.AddItem “P205”
CBOKODE.AddItem “P308”
CBOKODE.AddItem “P310”
CBOKODE.AddItem “P415”
CBOKODE.AddItem “P417”
CBOKODE.AddItem “P419”
End Sub

 

Tugas 5

Capture

Private Sub Command1_Click()
file1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
file1.Recordset.Delete
End Sub

Private Sub Command3_Click()
file1.Recordset.Update
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub Form_load()
txtkode.AddItem “A-SIM-01”
txtkode.AddItem “I-EDP-02”
txtkode.AddItem “S-MNJ-03”
txtkode.AddItem “E-CDR-04”
txtkode.AddItem “M-RPL-05”
End Sub

Private Sub Cmdproses_Click()
Dim S As String
Txttahun.Text = “20” & Right(txtkode.Text, 2)

S = Mid(txtkode.Text, 3, 3)
If S = “SIM” Then
Txtjudul = “SistemInformasiManajemen”
Txtpengarang = “YatiNurOktavia”
Txtharga = “75900”
ElseIf S = “EDP” Then
Txtjudul = “ElektronikData Processing”
Txtpengarang = “Imam Tarmizi”
Txtharga = “62000”
ElseIf S = “MNJ” Then
Txtjudul = “Manajemen”
Txtpengarang = “Valentina Mariana Adiwianti”
Txtharga = “42000”
ElseIf S = “CDR” Then
Txtjudul = “Corel Draw”
Txtpengarang = “RiyanSuhandi”
Txtharga = “53000”
ElseIf S = “RPL” Then
Txtjudul = “RekayasaPerangkatLunak”
Txtpengarang = “SintaUmpuSinga”
Txtharga = “83000”
End If

S = Left(Cbokode.Text, 1)
If S = “A” Then
Txtpenerbit = “Andi Offset Yogyakarta”
ElseIf S = “I” Then
Txtpenerbit = “Indah Surabaya”
ElseIf S = “S” Then
Txtpenerbit = “SalembaEmpat”
ElseIf S = “E” Then
Txtpenerbit = “Elek Media Komputindo”
ElseIf S = “M” Then
Txtpenerbit = “Maxicom”
End If
End Sub

Private Sub cmdlagi_click()
txtkode.SetFocus
txtkode = “”
Txtjudul = “”
Txtpengarang = “”
Txttahun = “”
Txtpenerbit = “”
Txtharga = “”
End Sub

Private Sub cmdbatal_click()
txtkode.SetFocus
txtkode = “”
Txtjudul = “”
Txtpengarang = “”
Txttahun = “”
Txtpenerbit = “”
Txtharga = “”
End Sub

Private Sub cmdkeluar_click()
End
End Sub

 

Tugas 6

Capture

Private Sub Cmdproses_Click()
Dim S As String
Dim Txttotal As Integer

S = Left(Txtkode.Text, 3)
If S = “BIM” Then
Txtharga = “50000”
Txtjenis = “BIMA”
Txtjam = “16.00”
ElseIf S = “EKO” Then
Txtharga = “35000”
Txtjenis = “EKONOMI”
Txtjam = “19.00”
ElseIf S = “MUT” Then
Txtharga = “23000”
Txtjenis = “MUTIARA”
Txtjam = “17.00”
ElseIf S = “SEN” Then
Txtharga = “15000”
Txtjenis = “SENJA”
Txtjam = “20.00”
End If
Txtjumlah.SetFocus
End Sub

Private Sub Command1_Click()
file1.Recordset.AddNew
End Sub
Private Sub Command2_Click()
file1.Recordset.Delete
End Sub

Private Sub Command3_Click()
file1.Recordset.Update
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub txtjumlah_keypress(keyascii As Integer)
If keyascii = 13 Then
Txttotal = Val(Txtharga) * Val(Txtjumlah)
End If
End Sub

Private Sub cmdlagi_click()
Txtkode.SetFocus
Txtkode = “”
Txtharga = “”
Txtjenis = “”
Txtjam = “”
Txtjumlah = “”
Txttotal = “”
End Sub

Private Sub cmdkeluar_click()
End
End Sub

 

Tugas 7

Capture

Private Sub Command1_Click()
file1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
file1.Recordset.Delete
End Sub

Private Sub Command3_Click()
file1.Recordset.Update
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub Form_load()
txtkode.AddItem “A-SIM-01”
txtkode.AddItem “I-EDP-02”
txtkode.AddItem “S-MNJ-03”
txtkode.AddItem “E-CDR-04”
txtkode.AddItem “M-RPL-05”
End Sub

Private Sub Cmdproses_Click()
Dim S As String
Txttahun.Text = “20” & Right(txtkode.Text, 2)

S = Mid(txtkode.Text, 3, 3)
If S = “SIM” Then
Txtjudul = “SistemInformasiManajemen”
Txtpengarang = “YatiNurOktavia”
Txtharga = “75900”
ElseIf S = “EDP” Then
Txtjudul = “ElektronikData Processing”
Txtpengarang = “Imam Tarmizi”
Txtharga = “62000”
ElseIf S = “MNJ” Then
Txtjudul = “Manajemen”
Txtpengarang = “Valentina Mariana Adiwianti”
Txtharga = “42000”
ElseIf S = “CDR” Then
Txtjudul = “Corel Draw”
Txtpengarang = “RiyanSuhandi”
Txtharga = “53000”
ElseIf S = “RPL” Then
Txtjudul = “RekayasaPerangkatLunak”
Txtpengarang = “SintaUmpuSinga”
Txtharga = “83000”
End If

S = Left(Cbokode.Text, 1)
If S = “A” Then
Txtpenerbit = “Andi Offset Yogyakarta”
ElseIf S = “I” Then
Txtpenerbit = “Indah Surabaya”
ElseIf S = “S” Then
Txtpenerbit = “SalembaEmpat”
ElseIf S = “E” Then
Txtpenerbit = “Elek Media Komputindo”
ElseIf S = “M” Then
Txtpenerbit = “Maxicom”
End If
End Sub

Private Sub cmdlagi_click()
txtkode.SetFocus
txtkode = “”
Txtjudul = “”
Txtpengarang = “”
Txttahun = “”
Txtpenerbit = “”
Txtharga = “”
End Sub

Private Sub cmdbatal_click()
txtkode.SetFocus
txtkode = “”
Txtjudul = “”
Txtpengarang = “”
Txttahun = “”
Txtpenerbit = “”
Txtharga = “”
End Sub

Private Sub cmdkeluar_click()
End
End Sub

 

Tugas 8

Capture

Private Sub Cmdproses_Click()
Dim S As String
S = Mid(Txtnik.Text, 5, 1)
If S = “A” Then
Txtgol.Text = “A”
Txtjabatan.Text = “Manager”
Txtgaji.Text = “4000000”
Txttunjangan.Text = “1025000”
ElseIf S = “B” Then
Txtgol.Text = “B”
Txtjabatan.Text = “Ka.seksi”
Txtgaji.Text = “3500000”
Txttunjangan.Text = “975000”
ElseIf S = “C” Then
Txtgol.Text = “C”
Txtjabatan.Text = “staff”
Txtgaji.Text = “3000000”
Txttunjangan.Text = “925000”
End If
S = Mid(Txtnik.Text, 7, 1)
If S = “S” Then
Txtkode.Text = “S”
Txtstatus.Text = “Single”
ElseIf S = “M” Then
Txtkode.Text = “M”
Txtstatus.Text = “Menikah”
ElseIf S = “J” Then
Txtkode.Text = “J”
Txtstatus.Text = “Janda”
ElseIf S = “D” Then
Txtkode.Text = “D”
Txtstatus.Text = “Duda”
End If
S = Right(Txtnik.Text, 3)
If S = “KEU” Then
Txtbagian.Text = “accounting”
ElseIf S = “ADM” Then
Txtbagian.Text = “administrasi”
ElseIf S = “SDM” Then
Txtbagian.Text = “general affair”
ElseIf S = “EDP” Then
Txtbagian.Text = “IT unit”
ElseIf S = “SPM” Then
Txtbagian.Text = “security”
End If
Txttahun.Text = Left(Txtnik.Text, 4)
Txttotal.Text = Val(Txtgaji) + Val(Txttunjangan)
End Sub

Private Sub Cmdbatal_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnik.Text = “”
Txtgol.Text = “”
Txtkode.Text = “”
Txtstatus.Text = “”
Txttahun.Text = “”
Txtjabatan.Text = “”
Txtbagian.Text = “”
Txtgaji.Text = “”
Txttunjangan.Text = “”
Txttotal.Text = “”
End Sub

Private Sub Cmdlagi_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnik.Text = “”
Txtgol.Text = “”
Txtkode.Text = “”
Txtstatus.Text = “”
Txttahun.Text = “”
Txtjabatan.Text = “”
Txtbagian.Text = “”
Txtgaji.Text = “”
Txttunjangan.Text = “”
Txttotal.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Command1_Click()
file1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
file1.Recordset.Delete
End Sub

Private Sub Command3_Click()
file1.Recordset.Update
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub txtnama_keypress(keyascii As Integer)
If keyascii = 13 Then
Txtnik.SetFocus
End If
End Sub

 

Tugas 9

77777777

Private Sub cmdadd_Click()
file1.Recordset.AddNew
End Sub

Private Sub cmdcancel_Click()
file1.Recordset.Delete
End Sub

Private Sub Cmdhitung_Click()
Txtby = Val(Txthb) * Val(Txtjb)
If Txtjb > 5 Then
Txtpot = Val(Txtby) * 0.02
ElseIf Txtjb <= 5 Then
Txtpot = “0”
End If
Txtttb = Val(Txtby) – Val(Txtpot)
End Sub

Private Sub cmdkeluar_Click()
Form2.Show
End Sub

Private Sub Cmdproses_Click()
Dim S As String
S = Mid(Txtkode.Text, 5, 2)
If S = “SP” Then
Txtnb = “spidol”
Txthb = “9500
ElseIf S = “BT” Then
Txtnb = “buku tulis”
Txthb = “12500”
ElseIf S = “TP” Then
Txtnb = “tip ex”
Txthb = “3000”
ElseIf S = “PG” Then
Txtnb = “penggaris”
Txthb = “25000”
ElseIf S = “PT” Then
Txtnb = “papan tulis”
Txthb = “50000
End If
Txtjb.SetFocus
End Sub

Private Sub cmdsave_Click()
file1.Recordset.Update
End Sub

Iklan

Tugas VB: Entri Penjualan LaptopAPPLE, Komputer, Data Buku, Tiket Kereta Api, Data Karyawan.

  • TUGAS 1-1 : Entri Penjualan Laptop Apple

Capture

Private Sub cbmkode_Click()
Select Case cbmkode.Text
Case Is = “Apple MC956 MacBook Air”
MERK = “Apple MC956 MacBook Air”
HS = “12800000”
Case Is = “Apple MC966 MacBook Air”
MERK = “Apple MC966 MacBook Air”
HS = “15800000”
Case Is = “Apple MC968 MacBook Air”
MERK = “Apple MC968 MacBook Air”
HS = “9900000”
Case Is = “Apple MC969 MacBook Air”
MERK = “Apple MC969 MacBook Air”
HS = “11900000”
Case Is = “Apple MC700 MacBook Pro”
MERK = “Apple MC700 MacBook Pro”
HS = “10800000”
Case Is = “Apple MC721 MacBook Pro”
MERK = “Apple MC721 MacBook Pro”
HS = “15900000”
Case Is = “Apple MC723 MacBook Pro”
MERK = “Apple MC723 MacBook Pro”
HS = “19300000”
Case Is = “Apple MC724 MacBook Pro”
MERK = “Apple MC724 MacBook Pro”
HS = “13700000”
Case Is = “Apple MC711 MacBook Pro”
MERK = “Apple MC711 MacBook Pro”
HS = “24200000”
Case Is = “Apple MC313 MacBook Pro”
MERK = “Apple MC313 MacBook Pro”
HS = “11900000”
Case Is = “Apple MC314 MacBook Pro”
MERK = “Apple MC314 MacBook Pro”
HS = “14700000”
Case Is = “Apple MC318 MacBook Pro”
MERK = “Apple MC318 MacBook Pro”
HS = “17600000”
Case Is = “Apple MC322 MacBook Pro”
MERK = “Apple MC322 MacBook Pro”
HS = “21300000”
Case Is = “Apple MC965 MacBook Air”
MERK = “Apple MC965 MacBook Air”
HS = “12800000”
Case Is = “Apple MC966 MacBook Air”
MERK = “Apple MC966 MacBook Air”
HS = “15800000”
End Select
Txtmerk.Text = MERK
Txths.Text = HS
Txtjj.SetFocus
End Sub

Private Sub cmdhitung_Click()
cbmkode.SetFocus
cbmkode.Text = “”
Txtmerk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdis.Text = “”
Txttb.Text = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Txthp.Text = Val(Txths.Text) * Val(Txtjj.Text)
Select Case Txthp.Text
Case Is > 140000000
discount = Val(Txthp.Text) * 0.15
Case Is > 135000000
discount = Val(Txthp.Text) * 0.1
Case Is > 130000000
discount = Val(Txthp.Text) * 0.05
Case Is > 125000000
discount = Val(Txthp.Text) * 0.02
End Select
Txtdis.Text = discount
Txttb.Text = Val(Txthp.Text) – Val(Txtdis.Text)
End Sub

Private Sub Form_Load()
cbmkode.AddItem “Apple MC956 MacBook Air”
cbmkode.AddItem “Apple MC966 MacBook Air”
cbmkode.AddItem “Apple MC968 MacBook Air”
cbmkode.AddItem “Apple MC969 MacBook Air”
cbmkode.AddItem “Apple MC700 MacBook Pro”
cbmkode.AddItem “Apple MC721 MacBook Pro”
cbmkode.AddItem “Apple MC723 MacBook Pro”
cbmkode.AddItem “Apple MC724 MacBook Pro”
cbmkode.AddItem “Apple MC711 MacBook Pro”
cbmkode.AddItem “Apple MC313 MacBook Pro”
cbmkode.AddItem “Apple MC314 MacBook Pro”
cbmkode.AddItem “Apple MC318 MacBook Pro”
cbmkode.AddItem “Apple MC322 MacBook Pro”
cbmkode.AddItem “Apple MC965 MacBook Air”
cbmkode.AddItem “Apple MC966 MacBook Air”
End Sub

  • TUGAS 1-2 : Entri Penjualan Komputer

Capture

 

 

Private Sub Cbokode_Click()
Dim kk, jk, hs As String
Select Case Cbokode.Text
Case “P205”
Txtjk.Text = “Pentium II 500 Mega Hz”
Txths.Text = “1500000”
Case “P308”
Txtjk.Text = “Pentium III 800 Mega Hz”
Txths.Text = “2100000”
Case “P310”
Txtjk.Text = “Pentium III 1.0 Giga Hz”
Txths.Text = “3500000”
Case “P415”
Txtjk.Text = “Pentium IV 1.5 Giga Hz”
Txths.Text = “4000000”
Case “P417”
Txtjk.Text = “Pentium IV 1.7 Giga Hz”
Txths.Text = “4200000”
Case “P419”
Txtjk.Text = “Pentium IV 1.9 Mega Hz”
Txths.Text = “5500000”
End Select
End Sub

Private Sub Cmdhitunglagi_Click()
Cbokode.SetFocus
Cbokode.Text = “”
Txtjk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdis.Text = “”
Txttb.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

Private Sub Cmdproses_Click()
Txthp.Text = Val(Txtjj.Text) * Val(Txths.Text)
If Txthp.Text > 30000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.15
ElseIf Txthp.Text > 25000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.1
ElseIf Txthp.Text > 20000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.5
ElseIf Txthp.Text > 15000000 Then
Txtdis.Text = Val(Txthp.Text) * 0.2
End If
Txttb.Text = Val(Txthp.Text) – Val(Txtdis.Text)
End Sub

Private Sub Form_Load()
Cbokode.AddItem “P205”
Cbokode.AddItem “P308”
Cbokode.AddItem “P310”
Cbokode.AddItem “P415”
Cbokode.AddItem “P417”
Cbokode.AddItem “P419”
End Sub

 

  • TUGAS 1-3 : Data Buku STMIK Pringsewu

Capture

Private Sub cmdbatal_Click()
txtkode.SetFocus
txtkode = “”
txtjudul = “”
txtpengarang = “”
txttahun = “”
txtpenerbit = “”
txtharga = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
txtkode.SetFocus
txtkode = “”
txtjudul = “”
txtpengarang = “”
txttahun = “”
txtpenerbit = “”
txtharga = “”
End Sub

Private Sub cmdproses_Click()
Dim KB As String
KB = Left(txtkode.Text, 3)
If KB = “A-SIM-01” Then
txtjudul = “Sistem Informasi Manajemen”
txtpengarang = “YatiNurOktavia”
txtharga = 75900
ElseIf KB = “I-EDP-02” Then
txtjudul = “Elektronik Data Processing”
txtpengarang = “Imam Tarmizi”
txtharga = 62000
ElseIf KB = “S-MNJ-03” Then
txtjudul = “Manajemen”
txtpengarang = “Valentina Mariana Adiwianti”
txtharga = 42000
ElseIf KB = “E-CDR-04” Then
txtjudul = “Corel Draw”
txtpengarang = “RiyanSuhandi”
txtharga = 53000
ElseIf KB = “M-RPL-05” Then
txtjudul = “Rekayasa Perangkat Lunak”
txtpengarang = “SintaUmpuSinga”
txtharga = 83000
End If
txttahun.Text = “20” & Mid(txtkode.Text, 5, 2)
KB = Right(txtkode.Text, 1)
If KB = “A” Then
txtpenerbit = “Andi Offset Yogyakarta”
ElseIf KB = “I” Then
txtpenerbit = “Indah Surabaya”
ElseIf KB = “S” Then
txtpenerbit = “Salemba Empat”
ElseIf KB = “E” Then
txtpenerbit = “Elek Media Komputindo”
ElseIf KB = “M” Then
txtpenerbit = “Maxicom”
End If
If Mid(txtkode.Text, 5, 2) = “01” Then
txttahun = “2001”
ElseIf Mid(txtkode.Text, 5, 2) = “02” Then
txttahun = “2002”
ElseIf Mid(txtkode.Text, 5, 2) = “03” Then
txttahun = “2003”
ElseIf Mid(txtkode.Text, 5, 2) = “04” Then
txttahun = “2004”
ElseIf Mid(txtkode.Text, 5, 2) = “05” Then
txttahun = “2005”
End If
End Sub

  • TUGAS 2-1 : Penjualan Tiket Kereta Api

Capture

Private Sub cmdlagi_Click()
txtkt.SetFocus
txtkt.Text = “”
txtht.Text = “”
txtjk.Text = “”
txtjb.Text = “”
txtjt.Text = “”
txttp.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdproses_Click()
Dim kt, jk, jb As String
Dim ht As Currency
kt = Left(txtkt.Text, 3)
If kt = “BIM” Then
ht = “50000”
jk = “BIMA”
jb = “1600”
ElseIf kt = “EKO” Then
ht = “35000”
jk = “EKONOMI”
jb = “1900”
ElseIf kt = “MUT” Then
ht = “23000”
jk = “MUTIARA”
jb = “1700”
ElseIf kt = “SEN” Then
ht = “15000”
jk = “SENJA”
jb = “2000”
End If
txtht.Text = ht
txtjk.Text = jk
txtjb.Text = jb
txtjt.SetFocus
End Sub

Private Sub Form_Activate()
txtkt.SetFocus
End Sub

Private Sub txtjt_keypress(keyascii As Integer)
If keyascii = 13 Then
txttp.Text = Val(txtht.Text) * Val(txtjt.Text)
txttp.SetFocus
End If
End Sub

  • TUGAS 2-3 : Data Karyawan

Capture

Private Sub cmdbatal_Click()
txtgl.SetFocus
txtgl.Text = “”
txtks.Text = “”
txtst.Text = “”
txtth.Text = “”
txtjb.Text = “”
txtbg.Text = “”
txtgp.Text = “”
txttj.Text = “”
txttg.Text = “”
txtnama.Text = “”
txtnik.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
txtgl.SetFocus
txtgl.Text = “”
txtks.Text = “”
txtst.Text = “”
txtth.Text = “”
txtjb.Text = “”
txtbg.Text = “”
txtgp.Text = “”
txttj.Text = “”
txttg.Text = “”
txtnama.Text = “”
txtnik.Text = “”
End Sub

Private Sub cmdproses_Click()
Dim s As String
txtth.Text = Left(txtnik.Text, 4)
s = Mid(txtnik.Text, 5, 1)
If s = “A” Then
txtgl.Text = “A”
txtjb.Text = “Manager”
txtgp.Text = “4000000”
txttj.Text = “1025000”
ElseIf s = “B” Then
txtgl.Text = “B”
txtjb.Text = “Ka.Seksi”
txtgp.Text = “3500000”
txttj.Text = “975000”
ElseIf s = “C” Then
txtgl.Text = “C”
txtjb.Text = “Staf”
txtgp.Text = “3000000”
txttj.Text = “925000”
End If
txttg.Text = Val(txtgp) + Val(txttj)
s = Mid(txtnik.Text, 7, 1)
If s = “S” Then
txtst.Text = “singel”
txtks.Text = “S”
ElseIf s = “M” Then
txtst.Text = “Menikah”
txtks.Text = “M”
ElseIf s = “J” Then
txtst.Text = “Janda”
txtks.Text = “J”
ElseIf s = “D” Then
txtst.Text = “Duda”
txtks.Text = “D”
End If
s = Mid(txtnik.Text, 9, 3)
If s = “KEU” Then
txtbg.Text = “Accounting”
ElseIf s = “ADM” Then
txtbg.Text = “Administrasi”
ElseIf s = “SDM” Then
txtbg.Text = “General Affair”
ElseIf s = “EDP” Then
txtbg.Text = “IT Unit”
ElseIf s = “SPM” Then
txtbg.Text = “Security”
End If
End Sub

Private Sub Form_Activate()
txtnama.SetFocus
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnik.SetFocus
End If
End Sub

  •  TUGAS 2-2 : Data Buku STMIK Pringsewu

Capture

Private Sub cmdbatal_Click()
Txtkode.SetFocus
Txtkode = “”
txtjudul = “”
txtpengarang = “”
txttahun = “”
txtpenerbit = “”
txtharga = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
Txtkode.SetFocus
Txtkode = “”
txtjudul = “”
txtpengarang = “”
txttahun = “”
txtpenerbit = “”
txtharga = “”
End Sub

Private Sub cmdproses_Click()
Dim KB As String
KB = Left(Txtkode.Text, 3)
If KB = “SIM-09-A” Then
txtjudul = “Sistem Informasi Manajemen”
txtpengarang = “FadiyaUlfa”
txtharga = 75900
ElseIf KB = “EDP-10-l” Then
txtjudul = “Elektronik Data Processing”
txtpengarang = “NurulAgustina”
txtharga = 62000
ElseIf KB = “MNJ-11-S” Then
txtjudul = “Manajemen”
txtpengarang = “RianHidayat”
txtharga = 42000
ElseIf KB = “CDR-12-E” Then
txtjudul = “Corel Draw”
txtpengarang = “SitiNurKhotimah”
txtharga = 53000
ElseIf KB = “RPL-13-M” Then
txtjudul = “Rekayasa Perangkat Lunak”
txtpengarang = “WindaErlianti”
txtharga = 83000
End If
txttahun.Text = “20” & Mid(Txtkode.Text, 5, 2)
KB = Right(Txtkode.Text, 1)
If KB = “A” Then
txtpenerbit = “Andi Offset Yogyakarta”
ElseIf KB = “I” Then
txtpenerbit = “Indah Surabaya”
ElseIf KB = “S” Then
txtpenerbit = “Salemba Empat”
ElseIf KB = “E” Then
txtpenerbit = “Elek Media Komputindo”
ElseIf KB = “M” Then
txtpenerbit = “Maxicom”
End If
If Mid(Txtkode.Text, 5, 2) = “13” Then
txttahun = “2013”
ElseIf Mid(Txtkode.Text, 5, 2) = “12” Then
txttahun = “2012”
ElseIf Mid(Txtkode.Text, 5, 2) = “11” Then
txttahun = “2011”
ElseIf Mid(Txtkode.Text, 5, 2) = “10” Then
txttahun = “2010”
ElseIf Mid(Txtkode.Text, 5, 2) = “09” Then
txttahun = “2009”
End If
End Sub

Tugas Pemograman 1 (Membuat Color Font, Style Font, Check Box, Combo Box).

  • Program 1 (Membuat Font Color, dan Font Style)

foto33

Private Sub chkunderline_Click()
If chkUnderline.Value = 1 Then
lblTeks.FontUnderline = True
Else
lblTeks.FontUnderline = False
End If
End Sub

Private Sub chkstrikeout_Click()
If chkStrikeout.Value = 1 Then
lblTeks.FontStrikethru = True
Else
lblTeks.FontStrikethru = 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 chkbold_Click()
If chkBold.Value = 1 Then
lblTeks.FontBold = True
Else
lblTeks.FontBold = False
End If
End Sub

Private Sub optblue_Click()
lblTeks.ForeColor = vbBlue
End Sub

Private Sub optgreen_Click()
lblTeks.ForeColor = vbGreen
End Sub

Private Sub optyellow_Click()
lblTeks.ForeColor = vbYellow
End Sub

Private Sub optred_Click()
lblTeks.ForeColor = vbRed
End Sub

 

  • Program 2 (Membuat Combo Box)

111

Private Sub cmbNpm_Click()
Dim Nama, Jurusan, HurufMutu As String
Case “15100008”
NM = “Ahmad Yudi”
JR = “Sistem Informasi”
Case “15100005”
NM = “Anggi Maharani”
JR = “Sistem Informasi”
Case “15100023”
NM = “Anggun Destriyanti”
JR = “Sistem Informasi”
Case “15100011”
NM = “Artika Kustriyani”
JR = “Sistem Informasi””
Case “15100040”
NM = “Bagas Anggara”
JR = “Sistem Informasi”
Case “15100017”
NM = “Desi Auliani”
JR = “Sistem Informasi”
Case “15100007”
NM = “Desi Yulianti”
JR = “Sistem Informasi”
Case “15100034”
NM = “Dimas Bima”
JR = “Sistem Informasi”
Case “15100033”
NM = “Dona Ari Wijaya”
JR = “Sistem Informasi”
Case “15100016”
NM = “Edwin Saputra”
JR = “Manajemen Informatika”
Case “15100004”
NM = “Evi Setyorini”
JR = “Manajemen Informatika”
Case “15100002”
NM = “Fergiawan Listianto”
JR = “Sistem Informasi”
Case “15100012”
NM = “Fisuryani”
JR = “Sistem Informasi”
Case “15100010”
NM = “Hermin Sukmiati”
JR = “Sistem Informasi”
Case “15100012”
NM = “Intan Ratnasari”
JR = “Sistem Informasi”
Case “15100014”
NM = “Ita Indriani”
JR = “Sistem Informasi”
Case “15100037”
NM = “Jepri Erlamsyah”
JR = “Sistem Informasi”
Case “15100010”
NM = “Laili Rizkia Putri”
JR = “Sistem Informasi”
Case “15100015”
NM = “M.Arif Rizki”
JR = “Sistem Informasi”
Case “15100016”
NM = “Mirzon Prananda”
JR = “Sistem Informasi”
Case “15100006”
NM = “Oktafiani”
JR = “Sistem Informasi”
Case “15100009”
NM = “Opi Laraswati”
JR = “Sistem Informasi”
Case “15100017”
NM = “Panji Wahyu Hantoro”
JR = “Sistem Informasi”
Case “15100025”
NM = “Rahmat Darmawan”
JR = “Sistem Informasi”
Case “15100003”
NM = “Renita Fitri”
JR = “Sistem Informasi”
Case “15100026”
NM = “Rezza Anggara”
JR = “Sistem Informasi”
Case “15100027”
NM = “Rio Adi Pradana”
JR = “Sistem Informatika”
Case “15100024”
NM = “Rizah Anggraeni”
JR = “Sistem Informasi”
Case “15100041”
NM = “Rudi Rizkyanto”
JR = “Sistem Informasi”
Case “15100026”
NM = “Stevanus Prihanuji”
JR = “Sistem Informasi”
Case “15100001”
NM = “Tia Anggraeni”
JR = “Sistem Informasi”
Case “15100019”
NM = “Tri Setia Ningsih”
JR = “Sistem Informasi”
Case “15100018”
NM = “Yusuf Sugianto”
JR = “Sistem Informasi”
End Select
TxtNM.Text = NM
TxtJR.Text = JR
TxtNilaiQ.SetFocus
End Sub

Private Sub Cmdbatal_Click()
cmbNpm.SetFocus
cmbNpm.Text = “”
TxtNM = “”
TxtJR.Text = “”
TxtNilaiQ.Text = “”
TxtNilaiT.Text = “”
TxtUts.Text = “”
TxtUas.Text = “”
TxtHasil.Text = “”
TxtHurufMutu.Text = “”
End Sub
Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdProses_Click()
Dim NilaiAkhir As Integer
Dim HurufMutu As String
NilaiQ = Val(TxtNilaiQ.Text)
NilaiT = Val(TxtNilaiT.Text)
Uts = Val(TxtUts.Text)
Uas = Val(TxtUas.Text)
NilaiAkhir = (NilaiQ + NilaiT + Uts + Uas) / 4
TxtHasil.Text = NilaiAkhir
Select Case TxtHasil.Text
Case Is > 80
HurufMutu = “A”
Case Is > 70
HurufMutu = “B”
Case Is > 60
HurufMutu = “C”
Case Is > 50
HurufMutu = “D”
Case Is < 50
HurufMutu = “E”
End Select
TxtHurufMutu.Text = HurufMutu
TxtHurufMutu.FontSize = 22
End Sub

Private Sub Form_Load()
Combo1.AddItem “15100008”
Combo1.AddItem “15100005”
Combo1.AddItem “15100023”
Combo1.AddItem “15100011”
Combo1.AddItem “15100040”
Combo1.AddItem “15100017”
Combo1.AddItem “15100007”
Combo1.AddItem “15100034”
Combo1.AddItem “15100033”
Combo1.AddItem “15100016”
Combo1.AddItem “15100004”
Combo1.AddItem “15100002”
Combo1.AddItem “15100012”
Combo1.AddItem “15100010”
Combo1.AddItem “15100012”
Combo1.AddItem “15100014”
Combo1.AddItem “15100037”
Combo1.AddItem “15100010”
Combo1.AddItem “15100015”
Combo1.AddItem “15100016”
Combo1.AddItem “15100006”
Combo1.AddItem “15100009”
Combo1.AddItem “15100017”
Combo1.AddItem “15100025”
Combo1.AddItem “15100003”
Combo1.AddItem “15100026”
Combo1.AddItem “15100027”
Combo1.AddItem “15100024”
Combo1.AddItem “15100041”
Combo1.AddItem “15100001”
Combo1.AddItem “15100011”
Combo1.AddItem “15100018”
Combo1.AddItem “15100019”
End Sub

Private Sub TxtNilaiQ_keypress(keyascii As Integer)
If keyascii = 13 Then
TxtNilaiT.SetFocus
End If
End Sub

Private Sub TxtNilaiT_keypress(keyascii As Integer)
If keyascii = 13 Then
TxtUts.SetFocus
End If
End Sub

Private Sub TxtUas_keypress(keyascii As Integer)
If keyascii = 13 Then
Dim NilaiAkhir As Integer
Dim HurufMutu As String
NilaiQ = Val(TxtNilaiQ.Text)
NilaiT = Val(TxtNilaiT.Text)
Uts = Val(TxtUts.Text)
Uas = Val(TxtUas.Text)
NilaiAkhir = (NilaiQ + NilaiT + Uts + Uas) / 4
TxtHasil.Text = NilaiAkhir
Select Case TxtHasil.Text
Case Is > 80
HurufMutu = “A”
Case Is > 70
HurufMutu = “B”
Case Is > 60
HurufMutu = “C”
Case Is > 50
HurufMutu = “D”
Case Is < 50
HurufMutu = “E”
End Select
TxtHurufMutu.Text = HurufMutu
TxtHurufMutu.FontSize = 22
End If
End Sub

Private Sub TxtUts_keypress(keyascii As Integer)
If keyascii = 13 Then
TxtUas.SetFocus
End If
End Sub

 

  • Program 3 (Membuat Fonts Style Ver 2)

foto11

Private Sub chktebal_Click()
If (chkTebal.Value = 1) And (chkTebal.Value = 1) Then
Label2.FontBold = True
Label2.FontItalic = False

ElseIf (chkTebal.Value = 1) And (chkTebal.Value = 0) Then
Label2.FontBold = False
Label2.FontItalic = False

ElseIf (chkTebal.Value = 0) And (chkTebal.Value = 1) Then
Label2.FontBold = False
Label2.FontItalic = True

ElseIf (chkTebal.Value = 0) And (chkTebal.Value = 0) Then
Label2.FontBold = False
Label2.FontItalic = False
End If
End Sub

Private Sub chkmiring_Click()
If (chkMiring.Value = 1) And (chkMiring.Value = 1) Then
Label2.FontBold = True
Label2.FontItalic = True

ElseIf (chkMiring.Value = 0) And (chkMiring.Value = 1) Then
Label2.FontBold = False
Label2.FontItalic = True

ElseIf (chkMiring.Value = 1) And (chkMiring.Value = 0) Then
Label2.FontBold = True
Label2.FontItalic = False

ElseIf (chkMiring.Value = 0) And (chkMiring.Value = 0) Then
Label2.FontBold = False
Label2.FontItalic = False
End If
End Sub

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

Private Sub cmdSelesai_Click()
Unload Me
End Sub

Private Sub optbiru_Click()
If optBiru.Value = True Then
Label2.ForeColor = vbBlue
End If
End Sub

Private Sub optmerah_Click()
If optMerah.Value = True Then
Label2.ForeColor = vbRed
End If
End Sub

Tugas VB : 1 – 8

  • Perkalian Dua Bilangan

Cara: 1

foto1

Private Sub Text1_keypress(keyasci As Integer)
If keyascii = 13 Then
Text2.SetFocus
End If
End Sub

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

Private Sub xhitung_Click()
Text3 = Val(Text1) * Val(Text2)
End Sub

Private Sub xKeluar_Click()
End
End Sub

 

  • Cara: 2

foto2

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

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

Private Sub xhitung_Click()
Text3 = Val(Text1) * Val(Text2)
End Sub

Private Sub xKeluar_Click()
End
End Sub

 

  • Kalkulator Mini

Cara: 1

foto1

Private Sub xBatal_Click()
xPenjumlahan1.SetFocus
xPenjumlahan1 = “”
xPenjumlahan2 = “”
xHasilPenjumlahan = “”
xPengurangan1 = “”
xPengurangan2 = “”
xHasilPengurangan = “”
xPerkalian1 = “”
xPerkalian2 = “”
xHasilPerkalian = “”
xPembagian1 = “”
xPembagian2 = “”
xHasilPembagian = “”
End Sub

Private Sub xKeluar_Click()
End
End Sub
Private Sub xPembagian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPembagian2.SetFocus
End If
End Sub

Private Sub xPengurangan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPengurangan2.SetFocus
End If
End Sub

Private Sub xPengurangan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPembagian1.SetFocus
End If
End Sub

Private Sub xPenjumlahan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPenjumlahan2.SetFocus
End If
End Sub

Private Sub xPenjumlahan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPerkalian1.SetFocus
End If
End Sub

Private Sub xPerkalian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPerkalian2.SetFocus
End If
End Sub

Private Sub xPerkalian2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPengurangan1.SetFocus
End If
End Sub

Private Sub xProses_Click()
xHasilPenjumlahan = Val(xPenjumlahan1) + Val(xPenjumlahan2)
xHasilPerkalian = Val(xPerkalian1) * Val(xPerkalian2)
xHasilPengurangan = Val(xPengurangan1) – Val(xPengurangan2)
xHasilPembagian = Val(xPembagian1) / Val(xPembagian2)
End Sub

Private Sub xUlangi_Click()
xPenjumlahan1.SetFocus
xPenjumlahan1 = “”
xPenjumlahan2 = “”
xHasilPenjumlahan = “”
xPerkalian1 = “”
xPerkalian2 = “”
xHasilPerkalian = “”
xPembagian1 = “”
xPembagian2 = “”
xHasilPembagian = “”
xPengurangan1 = “”
xPengurangan2 = “”
xHasilPengurangan = “”
End Sub

 

  • Cara: 2

foto2

Private Sub xBatal_Click()
xPenjumlahan1.SetFocus
xPenjumlahan1 = “”
xPenjumlahan2 = “”
xHasilPenjumlahan = “”
xPengurangan1 = “”
xPengurangan2 = “”
xHasilPengurangan = “”
xPerkalian1 = “”
xPerkalian2 = “”
xHasilPerkalian = “”
xPembagian1 = “”
xPembagian2 = “”
xHasilPembagian = “”
End Sub

Private Sub xKeluar_Click()
End
End Sub
Private Sub xPembagian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPembagian2.SetFocus
End If
End Sub

Private Sub xPengurangan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPengurangan2.SetFocus
End If
End Sub

Private Sub xPengurangan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPembagian1.SetFocus
xHasilPengurangan = Val(xPengurangan1) – (xPengurangan2)
End If
End Sub

Private Sub xPenjumlahan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPenjumlahan2.SetFocus
End If
End Sub

Private Sub xPenjumlahan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPerkalian1.SetFocus
xHasilPenjumlahan = Val(xPenjumlahan1) + (xPenjumlahan2)
End If
End Sub

Private Sub xPerkalian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPerkalian2.SetFocus
End If
End Sub

Private Sub xPerkalian2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPengurangan1.SetFocus
xHasilPerkalian = Val(xPerkalian1) * Val(xPerkalian2)
End If
End Sub

Private Sub xProses_Click()
xHasilPenjumlahan = Val(xPenjumlahan1) + Val(xPenjumlahan2)
xHasilPerkalian = Val(xPerkalian1) * Val(xPerkalian2)
xHasilPengurangan = Val(xPengurangan1) – Val(xPengurangan2)
xHasilPembagian = Val(xPembagian1) / Val(xPembagian2)
End Sub

Private Sub xUlangi_Click()
xPenjumlahan1.SetFocus
xPenjumlahan1 = “”
xPenjumlahan2 = “”
xHasilPenjumlahan = “”
xPerkalian1 = “”
xPerkalian2 = “”
xHasilPerkalian = “”
xPembagian1 = “”
xPembagian2 = “”
xHasilPembagian = “”
xPengurangan1 = “”
xPengurangan2 = “”
xHasilPengurangan = “”
End Sub

 

  • Perhitungan Harga Diskon

Cara: 1

foto1

Private Sub xDiskon_Change()
If KeyPress = 13 Then
xHargaAkhir = Val(xHargaAwal) – Val(xDiskon)
End If
End Sub

Private Sub xHargaAwal_KeyPress(KeyAscii As Integer)
If KeyPress = 13 Then
xDiskon = Val(xHargaAwal) * 0.1
End If
End Sub

Private Sub xHitung_Click()
xDiskon = Val(xHargaAwal) * 0.1
xHargaAkhir = Val(xHargaAwal) – Val(xDiskon)
End Sub

Private Sub xKeluar_Click()
Unload Me
End Sub

Private Sub xUlangi_Click()
xHargaAwal.SetFocus
xHargaAwal = “”
xDiskon = “”
xHargaAkhir = “”
End Sub

 

  • Cara: 2

foto2

Private Sub xDiskon_Change()
If KeyPress = 13 Then
xDiskon = Val(xHargaAwal) * 0.1
xHargaAkhir = Val(xHargaAwal) – Val(xDiskon)
End If
End Sub

Private Sub xHargaAwal_KeyPress(KeyAscii As Integer)
If KeyPress = 13 Then
xDiskon = Val(xHargaAwal) * 0.1
End If
End Sub

Private Sub xHitung_Click()
xDiskon = Val(xHargaAwal) * 0.1
xHargaAkhir = Val(xHargaAwal) – Val(xDiskon)
End Sub

Private Sub xKeluar_Click()
Unload Me
End Sub

Private Sub xUlangi_Click()
xHargaAwal.SetFocus
xHargaAwal = “”
xDiskon = “”
xHargaAkhir = “”
End Sub

 

  • Aplikasi Perhitungan Gaji

Cara: 1

foto1

Private Sub xGajiDiterima_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPajak = Val(xGajiKotor) – Val(xGajiDiterima)
xPajak.SetFocus
End If
End Sub

Private Sub xGajiKotor_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xGajiDiterima = Val(xGajiKotor) * 0.1
xGajiDiterima.SetFocus
End If
End Sub

Private Sub xGajiPokok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xTunjangan = Val(xGajiPokok) * 0.5
xTunjangan.SetFocus
End If
End Sub

Private Sub xKeluar_Click()
End
End Sub

Private Sub xLagi_Click()
xGajiPokok.SetFocus
xGajiPokok = “”
xTunjangan = “”
xPotongan = “”
xGajiKotor = “”
xGajiDiterima = “”
xPajak = “”
End Sub

Private Sub xPotongan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xGajiKotor = Val(xGajiPokok) + Val(xTunjangan) – Val(xPotongan)
xGajiKotor.SetFocus
End If
End Sub

Private Sub xProses_Click()
xTunjangan = Val(xGajiPokok) * 0.5
xPotongan = Val(xGajiPokok) * 0.4
xGajiKotor = Val(xGajiPokok) + Val(xTunjangan) – Val(xPotongan)
xGajiDiterima = Val(xGajiKotor) * 0.1
xPajak = Val(xGajiKotor) – Val(xGajiDiterima)
End Sub

Private Sub xTunjangan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPotongan = Val(xGajiPokok) * 0.4
xPotongan.SetFocus
End If
End Sub

 

  • Cara: 2

foto2

Private Sub xGajiDiterima_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xPajak = Val(xGajiKotor) – Val(xGajiDiterima)
xPajak.SetFocus
End If
End Sub

Private Sub xGajiKotor_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xGajiDiterima = Val(xGajiKotor) * 0.1
xGajiDiterima.SetFocus
End If
End Sub

Private Sub xGajiPokok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xTunjangan = Val(xGajiPokok) * 0.5
xTunjangan.SetFocus
End If
End Sub

Private Sub xKeluar_Click()
End
End Sub

Private Sub xLagi_Click()
xGajiPokok.SetFocus
xGajiPokok = “”
xTunjangan = “”
xPotongan = “”
xGajiKotor = “”
xGajiDiterima = “”
xPajak = “”
End Sub

Private Sub xPotongan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xGajiKotor = Val(xGajiPokok) + Val(xTunjangan) – Val(xPotongan)
xGajiKotor.SetFocus
End If
End Sub

Private Sub xProses_Click()
xTunjangan = Val(xGajiPokok) * 0.5
xPotongan = Val(xGajiPokok) * 0.4
xGajiKotor = Val(xGajiPokok) + Val(xTunjangan) – Val(xPotongan)
xGajiDiterima = Val(xGajiKotor) * 0.1
xPajak = Val(xGajiKotor) – Val(xGajiDiterima)
End Sub

Private Sub xTunjangan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
xTunjangan = Val(xGajiPokok) * 0.5
xPotongan = Val(xGajiPokok) * 0.4
xGajiKotor = Val(xGajiPokok) + Val(xTunjangan) – Val(xPotongan)
xGajiDiterima = Val(xGajiKotor) * 0.1
xPajak = Val(xGajiKotor) – Val(xGajiDiterima)
End If
End Sub

Tugas2: Biodata Mahasiswa

foto

Private Sub Command1xLagi_Click()
xNPM.SetFocus
xNPM = “”
xNAMA = “”
xALAMAT = “”
xPS = “”
xJR = “”
xAG = “”
End Sub

Private Sub Command2xBatal_Click()
xNPM.SetFocus
xNPM = “”
xNAMA = “”
xALAMAT = “”
xPS = “”
xJR = “”
xAG = “”
End Sub

Private Sub Command3xKeluar_Click()
End
End Sub

Private Sub Label3_Click()

End Sub

Private Sub xJR_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
xAG.SetFocus
End If
End Sub

Private Sub xPS_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
xJR.SetFocus
End If
End Sub

Private Sub xALAMAT_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
xPS.SetFocus
End If
End Sub

Private Sub xNAMA_KeyPress(Keysascii As Integer)
If Keyascii = 13 Then
xALAMAT.SetFocus
End If
End Sub

Private Sub xNPM_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
End If
End Sub

Tugas1: Form Data Mahasiswa

foto

Private Sub Command1xLagi_Click()
xNPM.SetFocus
xNPM = “”
xNAMA = “”
xALAMAT = “”
End Sub

Private Sub Command2xBatal_Click()
xNPM.SetFocus
xNPM = “”
xNAMA = “”
xALAMAT = “”
End Sub

Private Sub Command3xKeluar_Click()
End
End Sub

Private Sub xNAMA_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
xALAMAT.SetFocus
End If
End Sub

Private Sub xNPM_KeyPress(Keyascii As Integer)
If Keyascii = 13 Then
xNAMA.SetFocus
End If
End Sub

Berbuat Baik kepada Orang Tua Merupakan Kewajiban bagi Muslim

Featured image

“Dan Kami pesankan kepada manusia (agar berbuat baik) kepada kedua orang tuanya, ibunya telah mengandungnya dalam keadaan lemah yang bertambah-tambah dan menyapihnya dalam dua tahun. Bersyukurlah kepada-Ku dan kepada kedua orang tuamu. Hanya kepada aku kembalimu.”(QS. Lukman:14).

Berbuat baik kepada orang tua merupakan suatu kewajiban bagi seorang Muslim. Dalam ayat 83 surat Al Baqarah, ayat 36 surat An Nisa, ayat 151 surat Al An’am dan ayat 23 surat Al Isra, Allah SWT memerintahkan manusia untuk berbuat baik kepada ibu bapaknya.

Di dalam surat Al-Luqman ayat 14 dijelaskan bahwa berbuat baik kepada kedua orang tua merupakan pesan langsung dari Allah SWT.

Ulama Mohsen Qaraati di dalam bukunya menjelaskan, bahwa kedudukan kedua orang tua begitu tinggi. Tapi, dalam satu ayat dikatakan, jika kedua orang tua mengajakmu terhadap perbuatan syirik, jangan Engkau taati, namun tetaplah Engkau memutuskan berbuat baik kepada mereka.

Artinya, menurutnya, pada saat tidak boleh menaati mereka (orang tua), tetap terlarang meninggalkan mereka. Menghormati ibu bapak termasuk kewajiban manusiawi serta kewajiban yang terus-menerus dan bukan kewajiban kontemporer. Wallahu a’lam bishowab.

Sumber: http://www.aktual.com/berbuat-baik-kepada-orang-tua-merupakan-kewajiban-bagi-muslim/

Alhamdulilah, Salat Istisqa Dilakukan Anggota DPR Diijabah Allah SWT

Featured image

Pimpinan DPR beserta anggota DPR dan pegawai Sekretariat Jenderal DPR melakukan salat istisqa di lapangan bola kompleks MPR/DPR/DPD RI pada hari Jumat (30/10) lalu diijabah oleh Allah SWT.

Alhasil, pada Senin (02/11) malam, sekitar pukul 20.30 WIB hingga pukul 22.00 WIB, Jakarta diguyur hujan yang tidak pernah turun hampir tiga bulan lamanya.

Salat istisqa yang diimami oleh Imam Besar Masjid Istiqlal Jakarta, KH Ali Mustofa Yacub itu adalah ikhtiar pimpinan DPR RI untuk mengatasi persoalan El Nino yang berkepanjangan dan kabut asap akibat pembakaran hutan oleh oknum-oknum tertentu itu harus diapresiasi dan tidak bisa dipandang remeh apalagi di-‘bully’.

Hal positif yang dilakukan jajaran anggota DPR itu membasahi kegersangan yang sedang melanda Tanah Air kita.

Sumber: http://www.aktual.com/alhamdulilah-salat-istisqa-dilakukan-anggota-dpr-diijabah-allah-swt/

Muhammadiyah Ajak Muslim Selalu Beramal di Tengah Keterbatasan

Featured image

Warga Muhammadiyah diajarkan untuk banyak beramal soleh sekalipun dalam kondisi penuh keterbatasan, demikian kata Ketua Umum Pimpinan Pusat (PP) Muhammadiyah Dr. Haedar Nashir, M.Si dalam keterangan PCIM Malaysia, kepada wartawan, Selasa (03/11).

Disebutkannya, Muhammadiyah melalui pendekatan “sedikit bicara banyak bekerja” mengajarkan warganya untuk senantiasa beramal soleh meski penuh keterbatasan.

“Ini karena amal soleh diukur berdasarkan kondisi dan kemampuan masing-masing individu,” demikian yang disampaikannya dalam acara ‘Tabligh Akbar’ di Gedung Kedutaan Besar Republik Indonesia (KBRI) Kuala Lumpur, Malaysia, Sabtu (31/10) lalu.

Menurut dia, ukuran kemampuan adalah subyektif, tergantung apa yang dimiliki oleh orang tersebut.

“Tidak tepat jika seseorang merasa tidak memiliki kemampuan untuk beramal soleh dan hanya akan beramal jika merasa telah mapan,” tegasnya.

Ciri-ciri menekankan amal sholeh ini adalah salah satu komponen ciri Islam yang berkemajuan.

Dalam konteks inilah Muhammadiyah dalam usianya yang lebih satu abad telah melahirkan berbagai institusi pendidikan, kesehatan dan kebajikan masyarakat di seluruh pelosok Indonesia sebagai wujud amal sholeh.

Menanggapi fakta besarnya jumlah buruh migran Indonesia di Malaysia, Haedar Nashir berharap mereka yang hijrah dari Indonesia ke Malaysia ini memaknai perpindahan mereka tidak sekadar sebagai perpindahan jasmani.

Tapi, lanjut dia, juga momentum rohaniah, yaitu sebagai sebuah hijrah untuk menjadi lebih baik sebagai hamba Allah SWT dan Khalifah Allah di muka Bumi.

Dalam kaitan ini pula, Koordinator Fungsi Penerangan, Sosial, Budaya (Pensosbud) KBRI Kuala Lumpur, Trigustono Suprianto, berharap agar PCIM dapat terus membantu mensosialisasikan pentingnya bekerja secara legal agar tidak mendapatkan masalah di kemudian hari.

Sementara itu, Tabligh akbar yang bertema ‘Semangat Hijrah menuju Islam yang berkemajuan’ itu dihadiri ratusan warga Indonesia di Malaysia termasuk buruh migran, mahasiswa, ibu rumah tangga.

Acara ini juga dihadiri kalangan pekerja profesional yang tergabung dalam Pimpinan Cabang Istimewa Muhammadiyah dan Aisyiyah (PCIM & PCIA) Malaysia, serta perwakilan beberapa ormas dan parpol Indonesia yang berbasis di Malaysia.

Sumber: http://www.aktual.com/muhammadiyah-ajak-muslim-selalu-beramal-di-tengah-keterbatasan/

Warga Meriahkan Pawai Taaruf Lomba MTQ di Cirebon

Featured image

Sebagian masyarakat kota Cirebon, Jawa Barat, meriahkan acara pawai taaruf lomba Musabaqah Tilawatil Quran (MTQ) tingkat kota Cirebon yang akan dilaksanakan pada tanggal 3 dan 4 November 2015 mendatang, dan melombakan empat cabang perlombaan.

Wali Kota Cirebon, Nasrusin Azis dalam pembukaan dan pelepasan pawai taaruf MTQ, Selasa (03/11), mengatakan ia sangat berterimakasih atas kehadiran masyarakat untuk menyaksikan dan mengikuti pawai tersebut, dimana antusias masyarakat terhadap perlombaan MTQ begitu besar.

“Masyarakat begitu antusias mengikuti pawai taaruf MTQ,” katanya.

Ia juga mengharapkan dengan adanya perlombaan MTQ itu bisa memunculkan qori dan qoriah yang baik serta bisa menerapkan isi dan kandungan Al Quran juga bisa mewakili Cirebon dalam ajang MTQ tingakt Jabar dan bahkan Nasional.

“Saya sebagai pemerintah kota mengharapkan dengan adanya MTQ tingkat kota bisa menumbuhkan dan memunculkan para qori yang bisa mewakili Cirebon,” tuturnya.

Nasrudin juga memberikan himbauan untuk para juri, agar bisa se adil mungkin dalam menilai perlombaan itu dan Ia juga menuturkan jangan sampai ada “titipan” perlombaan, dimana semua peserta harus sama dalam hal penilaian, jangan sampai para juri tidak adil.

Sementara itu, Jaja Sulaiman selaku ketua panitia MTQ tingkat Kota Cirebon menambahkan MTQ tingkat kota ini diikuti beberapa peserta yang mewakili kecamatan masing-masing, dimana perlombaan MTQ kali ini melombakan empat kategori yang dilombakan.

“Perlombaan MTQ ini ada empat cabang perlombaan yaitu, tahfidz, musabaqah, Sariil dan tahmil,” tambahnya.

Acara pawai taaruf MTQ tingkat kota Cirebon dimulai sekitar pukul 14.30 WIB yang dibuka secara langsung oleh Wali Kota di halaman Balai Kota Cirebon.

Sumber: http://www.aktual.com/warga-meriahkan-pawai-taaruf-lomba-mtq-di-cirebon/