Selasa, 21 Maret 2017

Program Aplikasi Penjualan Makanan

KODE PADA KOLOM PILIHAN MAKANAN

Private Sub cbomakanan_Click()
Select Case cbomakanan.Text
Case "Bakso Segitiga Pedas"
txthrgmak.Text = "20000"
Case "Bakso Gulung"
txthrgmak.Text = "15000"
Case "Mie Ayam Bakso"
txthrgmak.Text = "15000"
Case "Mie Ayam"
txthrgmak.Text = "12000"
Case "Mie Pangsit"
txthrgmak.Text = "10000"
Case "Mie Tek-tek"
txthrgmak.Text = "10000"
Case "Nasi Uduk"
txthrgmak.Text = "5000"
Case "Nasi Goreng"
txthrgmak.Text = "14000"
End Select
End Sub

KODE PADA KOLOM PILIHAN MINUMAN

Private Sub cbominuman_Click()
Select Case cbominuman.Text
Case "Es teh manis"
txthrgmin.Text = "4000"
Case "Es Cappucino"
txthrgmin.Text = "5000"
Case "Es susu"
txthrgmin.Text = "6000"
Case "Jus Jeruk"
txthrgmin.Text = "8000"
Case "Jus Mangga"
txthrgmin.Text = "8000"
Case "Jus Alpukat"
txthrgmin.Text = "8000"
Case "Jus Melon"
txthrgmin.Text = "8000"
Case "Jus Buah Naga"
txthrgmin.Text = "9000"
Case "Sop Buah"
txthrgmin.Text = "9000"
End Select
txtmak.SetFocus

End Sub


KODE PADA TOMBOL CLEAR

Private Sub cmdhapus_Click()
cbomakanan.Clear
cbominuman.Clear
Option1.Value = False
txthrgmak.Text = ""
txthrgmin.Text = ""
txtmak.Text = ""
txtmin.Text = ""
txtjumlah.Text = ""
txtbayar.Text = ""
txtkembali.Text = ""
End Sub


KODE PADA TOMBOL EXIT

Private Sub cmdkeluar_Click()
a = MsgBox("Anda yakin ingin keluar?", vbQuestion + vbYesNo, "Keluar")
If a = vbYes Then
End
End If
End Sub

KODE PADA SUB FORM LOAD

Private Sub Form_Load()
cbomakanan.AddItem "Bakso Segitiga Pedas"
cbomakanan.AddItem "Bakso Gulung"
cbomakanan.AddItem "Mie Ayam Bakso"
cbomakanan.AddItem "Mie Ayam"
cbomakanan.AddItem "Mie Pangsit"
cbomakanan.AddItem "Mie Tek-tek"
cbomakanan.AddItem "Nasi Uduk"
cbomakanan.AddItem "Nasi Goreng"

End Sub

KODE PADA OPTION

Private Sub Option1_Click()
If Option1.Value = True Then
cbominuman.AddItem "Es teh manis"
cbominuman.AddItem "Es Cappucino"
cbominuman.AddItem "Es susu"
cbominuman.AddItem "Jus Jeruk"
cbominuman.AddItem "Jus Mangga"
cbominuman.AddItem "Jus Alpukat"
cbominuman.AddItem "Jus Melon"
cbominuman.AddItem "Jus Buah Naga"
cbominuman.AddItem "Sop Buah"
End If
End Sub

KODE MENGGUNAKAN ENTER

Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali.Text = Val(txtbayar.Text) - Val(txtjumlah.Text)
End If
End Sub

KODE HASIL MENGGUNAKAN ENTER

Private Sub txtmin_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtjumlah.Text = Val(txtmak.Text) * Val(txthrgmak) + Val(txtmin.Text) * Val(txthrgmin)
txtbayar.SetFocus
End If
End Sub

Program Aplikasi Penjualan Barang


Kode Combo Box Nama Barang:
Private Sub cbonamabarang_Click()
If cbonamabarang.Text = "CINCIN" Then
txtharga.Text = "150000"
ElseIf cbonamabarang.Text = "KALUNG" Then
txtharga.Text = "250000"
End If
txtjumlah.SetFocus
End Sub
 
Kode Sub Form Load :
Private Sub Form_Load()
cbonamabarang.AddItem "CINCIN"
cbonamabarang.AddItem "KALUNG"
End Sub

Kode Tombol Belanja Lagi:
Private Sub cmdbelanjalagi_Click()
txtno.Text = ""
txtnamapembeli.Text = ""
txtharga.Text = ""
txtjumlah.Text = ""
txtdiskon.Text = ""
txttotal.Text = ""
cbonamabarang.Text = ""
txtno.SetFocus
End Sub


Kode Tombol Keluar:
Private Sub cmdkeluar_Click()
Unload Me
End Sub

Kode Tombol Hitung Total Belanja:
Private Sub txttotal_Click()
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text) - Val(txtdiskon.Text)
End Sub

Rabu, 15 Maret 2017

Program Aplikasi Peminjaman Buku


Kode Program Combo Box Kode Buku :

Private Sub cbokode_Click()
If cbokode.Text = "001" Then
txtjudul.Text = "Visual Basic"
txtpenerbit.Text = "Erlangga"
ElseIf cbokode.Text = "002" Then
txtjudul.Text = "Bahasa Indonesia"
txtpenerbit.Text = "Erlangga"
ElseIf cbokode.Text = "003" Then
txtjudul.Text = "Statistik"
txtpenerbit.Text = "Erlangga"
End If
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
cbokode.AddItem "001"
cbokode.AddItem "002"
cbokode.AddItem "003"
End Sub


Kode Program Tombol Pinjam Lagi :
Private Sub cmdpinjam_Click()
txtnomor.Text = ""
txtnama.Text = ""
cbokode.Text = ""
txtjudul.Text = ""
txtpenerbit.Text = ""
txtpinjam.Text = ""
txtkembali.Text = ""
txtnomor.SetFocus
End Sub

Kode Program Tombol Proses :
Private Sub cmdproses_Click()
txtkembali.Text = Val(txtpinjam.Text) + 7
End Sub

Kode Program Tombol Selesai :
Private Sub cmdselesai_Click()
Unload Me
End Sub

Program Aplikasi Gaji Karyawan


Kode Program Combo Box Jabatan :

Private Sub cbojabatan_Click()
If cbojabatan.Text = "M. Produksi" Then
txtpokok.Text = "3000000"
txttunjangan.Text = "1000000"
ElseIf cbojabatan.Text = "M. Personalia" Then
txtpokok.Text = "2500000"
txttunjangan.Text = "1000000"
ElseIf cbojabatan.Text = "M. Pemasaran" Then
txtpokok.Text = "2000000"
txttunjangan.Text = "500000"
ElseIf cbojabatan.Text = "M. Keuangan" Then
txtpokok.Text = "4000000"
txttunjangan.Text = "1500000"
End If
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
cbojabatan.AddItem "M. Produksi"
cbojabatan.AddItem "M. Personalia"
cbojabatan.AddItem "M. Pemasaran"
cbojabatan.AddItem "M. Keuangan"
End Sub


Kode Program Tombol Keluar :
Private Sub cmdkeluar_Click()
Unload Me
End Sub

Kode Program Tombol Mulai Lagi :
Private Sub cmdlagi_Click()
txtnama.Text = ""
txtnip.Text = ""
cbojabatan.Text = ""
txttunjangan.Text = ""
txtpajak.Text = ""
txtbersih.Text = ""
txtpokok.Text = ""
txtnama.SetFocus
End Sub

Kode Program Tombol Total :
Private Sub cmdtotal_Click()
txtpajak.Text = Val(txtpokok.Text) * 5 / 100
txtbersih.Text = Val((txtpokok.Text) + Val(txttunjangan.Text)) - Val(txtpajak.Text)
End Sub

Program Aplikasi Penjualan Toko Menggunakan ComboBox



Kode Program Combo Box Nomor Barang :
Private Sub cbonomor_Click()
If cbonomor.Text = "1" Then
txtbarang.Text = "sabun"
txtharga.Text = "2000"
ElseIf cbonomor.Text = "2" Then
txtbarang.Text = "rinso"
txtharga.Text = "1000"
ElseIf cbonomor.Text = "3" Then
txtbarang.Text = "shampo"
txtharga.Text = "3000"
ElseIf cbonomor.Text = "4" Then
txtbarang.Text = "pena"
txtharga.Text = "4000"
End If
txtjumlah.SetFocus
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
cbonomor.AddItem "1"
cbonomor.AddItem "2"
cbonomor.AddItem "3"
cbonomor.AddItem "4"
End Sub

Kode Program Tombol Hitung :
Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
End Sub

Kode Program Tombol Hitung Lagi :
Private Sub cmdhitunglagi_Click()
txtnama.Text = " "
cbonomor.Text = " "
txtbarang.Text = " "
txtharga.Text = " "
txtjumlah.Text = " "
txtbayar.Text = "  "
txtnama.SetFocus
End Sub

Kode Program Tombol Selesai :
Private Sub cmdselesai_Click()
Unload Me
End Sub

Program Aplikasi Pengurangan 2 Bilangan


Kode Program Tombol Hitung :
Private Sub cmdhitung_Click()
txthasil.Text = Val(txtnilaipertama.Text) - Val(txtnilaikedua.Text)
End Sub

Kode Program Tombol Hitung lagi :
Private Sub cmdhitunglagi_Click()
txtnilaipertama.Text = " "
txtnilaikedua.Text = " "
txtnilaiketiga.Text = " "
txthasil.Text = " "
txtnilaipertama.SetFocus
End Sub

Kode Program Tombol Selesai :
Private Sub cmdselesai_Click()
Unload Me
End Sub

Selasa, 14 Maret 2017

Program Aplikasi Penjumlahan 2 Bilangan


Kode Program Tombol Hitung :
Private Sub cmdhitung_Click()
txthasil.Text = Val(txtnilaipertama.Text) + Val(txtnilaikedua.Text)
End Sub

Kode Program Tombol Hitung Lagi :
Private Sub cmdhitunglagi_Click()
txtnilaipertama.Text = " "
txtnilaikedua.Text = " "
txthasil.Text = " "
txtnilaipertama.SetFocus
End Sub

Kode Program Tombol Selesai :
Private Sub cmdselesai_Click()
Unload Me
End Sub

Program Aplikasi Pendaftaran Peminjaman Buku



Kode Program Tombol Kode Buku :
Private Sub CboKode_Click()
If CboKode.Text = "110" Then
    TxtJudul.Text = "Photoshop"
    TxtPenulis.Text = "Doni Albana"
    TxtRak.Text = "R1"
ElseIf CboKode.Text = "111" Then
    TxtJudul.Text = "Corel Draw"
    TxtPenulis.Text = "Kerin Naoula"
    TxtRak.Text = "R2"
ElseIf CboKode.Text = "112" Then
    TxtJudul.Text = "Jaringan"
    TxtPenulis.Text = "Jonathan Fernan"
    TxtRak.Text = "R4"
ElseIf CboKode.Text = "113" Then
    TxtJudul.Text = "LAN"
    TxtPenulis.Text = "Goul"
    TxtRak.Text = "R3"
ElseIf CboKode.Text = "114" Then
    TxtJudul.Text = "PHP"
    TxtPenulis.Text = "Law"
    TxtRak.Text = "R5"
Else
    TxtJudul.Text = "Java"
    TxtPenulis.Text = "Rito"
    TxtRak.Text = "R6"
End If
TxtTerlambat.SetFocus
End Sub

Kode Program Tombol Lagi :
Private Sub CmdLagi_Click()
TxtJudul.Text = ""
TxtPenulis.Text = ""
TxtRak.Text = ""
CboKode.Text = ""
TxtNama.Text = ""
TxtTerlambat.Text = ""
TxtDenda.Text = ""
TxtNama.SetFocus
End Sub

Kode Program Tombol Keluar :
Private Sub CmdKeluar_Click()
If MsgBox("Anda Yakin Ingin Keluar", vbYesNo, "kotak pesan") = vbYes Then
End
End If
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
CboKode.AddItem "110"
CboKode.AddItem "111"
CboKode.AddItem "112"
CboKode.AddItem "113"
CboKode.AddItem "114"
CboKode.AddItem "115"
End Sub

Kode Program Tombol Denda :
Private Sub TxtTerlambat_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtDenda.Text = Val(TxtTerlambat.Text) * 3000
End If
End Sub

Program Aplikasi Nilai Mahasiswa


Kode Program Tombol Keluar :
Private Sub CmdKeluar_Click()
Unload Me
End Sub

Kode Program Tombol Lagi :
Private Sub CmdLagi_Click()
TxtNpm.Text = ""
TxtNama.Text = ""
TxtAbsen.Text = ""
TxtKuis.Text = ""
TxtTugas.Text = ""
TxtUts.Text = ""
TxtUas.Text = ""
TxtNA.Text = ""
Label2.Caption = ""
TxtNpm.SetFocus
End Sub

Kode Program Tombol Proses :
Private Sub CmdProses_Click()
TxtNA.Text = (Val(TxtAbsen.Text) + Val(TxtKuis.Text) + Val(TxtTugas.Text) + Val(TxtUts.Text) + Val(TxtUas.Text)) / 5
If TxtNA.Text >= 80 Then
Label2.Caption = " A"
ElseIf TxtNA.Text >= 73 Then
Label2.Caption = "B"
ElseIf TxtNA.Text >= 65 Then
Label2.Caption = "C"
Else
Label2.Caption = "BL"
End If
End Sub

Kode Sub Txt Absen :
Private Sub TxtAbsen_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtKuis.SetFocus
End If
End Sub

Kode Sub Txt Kuis :
Private Sub TxtKuis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTugas.SetFocus
End If
End Sub

Kode Sub Txt Nama :
Private Sub TxtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtAbsen.SetFocus
End If
End Sub

Kode Sub Txt Npm :
Private Sub TxtNpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNama.SetFocus
End If
End Sub

Kode Sub Txt Tugas :
Private Sub TxtTugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtUts.SetFocus
End If
End Sub

Kode Sub Txt Uts :
Private Sub TxtUts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtUas.SetFocus
End If
End Sub

Program Aplikasi Dalam Toko


Kode Program Tombol Hitung Total Belanja :
Private Sub CmdHitung_Click()
TxtTotal.Text = Val(TxtJumlahbarang.Text) * Val(TxtHarga.Text) - Val(TxtDiskon.Text)
End Sub

Kode Program Tombol Keluar :
Private Sub CmdKeluar_Click()
Unload Me
End Sub

Kode Program Tombol Belanja Lagi :
Private Sub CmdLagi_Click()
TxtNomor.Text = ""
TxtPembeli.Text = ""
TxtBarang.Text = ""
TxtHarga.Text = ""
TxtJumlahbarang = ""
TxtDiskon = ""
TxtTotal.Text = ""
TxtNomor.SetFocus
End Sub

Program Aplikasi Penerimaan Siswa Baru


Kode Program Combo Box Jurusan Yang Dipilih :
Private Sub CboJurusan_Click()
If CboJurusan.Text = "S1 Sistem Informasi" Then
TxtPropti.Text = "350000"
TxtBiayaPen.Text = "300000"
Else
TxtPropti.Text = "300000"
TxtBiayaPen.Text = " 300000"
End If
TxtHarus.Text = Val(TxtBiaya.Text) + Val(TxtPropti.Text) + Val(TxtBiayaPen.Text)
End Sub

Kode Program Combo Box Program Yang Dipilih :
Private Sub CboProgram_Click()
If CboProgram.Text = "Reguler" Then
TxtBiaya.Text = "3500000"
Else
TxtBiaya.Text = "4000000"
End If
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
CboProgram.AddItem "Reguler"
CboProgram.AddItem "eksekutif"
CboJurusan.AddItem "S1 Sistem Informasi"
CboJurusan.AddItem "D3 Manajemen Informatika"
CboTahun.AddItem "2013"
CboTahun.AddItem "2014"
CboTahun.AddItem "2015"
CboTahun.AddItem "2016"
End Sub

Kode Program Tombol Daftar Baru :
Private Sub CmdDaftar_Click()
TxtNama.Text = ""
TxtJenis.Text = ""
TxtAlamat.Text = ""
TxtAsal.Text = ""
TxtBiaya.Text = ""
TxtOrangtua.Text = ""
TxtPropti.Text = ""
TxtBiayaPen.Text = ""
TxtHarus.Text = ""
CboProgram.Text = ""
CboJurusan.Text = ""
CboTahun.Text = ""
TxtNama.SetFocus
End Sub

Kode Program Tombol Selesai :
Private Sub CmdSelesai_Click()
Unload Me
End Sub

Kode Program Option Jenis Kelamin :
Private Sub OptLaki_Click()
TxtJenis.Text = "Laki-laki"
End Sub

Private Sub OptPerempuan_Click()
TxtJenis.Text = "Perempuan"
End Sub

Kode Program Tombol Yang Harus Dibayar :
Private Sub TxtHarus_Click()
TxtHarus.Text = Val(TxtBiaya.Text) + Val(TxtPropti.Text) + Val(TxtBiayaPen.Text)
End Sub

Program Aplikasi Penjualan Obat


Kode Program Tombol Nama Produk :
Private Sub CboPilih_Click()
If CboPilih.Text = "Mouse" Then
TxtHarga.Text = "35000"
ElseIf CboPilih.Text = "Keyboard" Then
TxtHarga.Text = "80000"
ElseIf CboPilih.Text = "CPU" Then
TxtHarga.Text = "300000"
End If
TxtJumlah.SetFocus
End Sub

Kode Sub Form Load :
Private Sub Form_Load()
CboPilih.AddItem "Mouse"
CboPilih.AddItem "Keyboard"
CboPilih.AddItem "CPU"
End Sub

Kode Program Tombol Hitung :
Private Sub CmdHitung_Click()
TxtTotal.Text = Val(TxtUang.Text) - Val(TxtHarga.Text) * Val(TxtJumlah.Text)
End Sub

Kode Program Tombol Beli Lagi :
Private Sub CmdLagi_Click()
TxtID.Text = ""
TxtNama.Text = ""
TxtAlamat.Text = ""
TxtNo.Text = ""
TxtNamaProduk.Text = ""
TxtHarga.Text = ""
TxtJumlah.Text = ""
TxtUang.Text = ""
TxtTotal.Text = ""
TxtID.SetFocus
End Sub

Kode Program Tombol Selesai :
Private Sub CmdSelesai_Click()
Unload Me
End Sub

Kode Program Tombol Enter :
Private Sub TxtTotal_KeyPress(KeyAscii As Integer)
TxtTotal.Text = Val(TxtUang.Text) - Val(TxtHarga.Text) * Val(TxtJumlah.Text)
End Sub