Jumat, 17 Maret 2017

Program Penjualan Perhiasan


KODE PADA KOLOM 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 PADA 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 PADA TOMBOL HITUNG TOTAL BELANJA

Private Sub cmdhitung_Click()
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text) - Val(txtdiskon.Text)
End Sub

KODE PADA TOMBOL KELUAR 

Private Sub cmdkeluar_Click()
Unload Me
End Sub

KODE MEMUNCULKAN NAMA BARANG

Private Sub Form_Load()
cbonamabarang.AddItem "CINCIN"
cbonamabarang.AddItem "KALUNG"
End Sub


Penjualan Toko Maju




KODE PADA KOLOM NOMOR BARANG

Private Sub Cmbnomor_Click()
If Cmbnomor.Text = "44" Then
txtbarang.Text = "biore"
txtharga.Text = "15000"
ElseIf Cmbnomor.Text = "55" Then
txtbarang.Text = "marina"
txtharga.Text = "20000"
ElseIf Cmbnomor.Text = "66" Then
txtbarang.Text = "supermi"
txtharga.Text = "4000"
End If
End Sub

KODE PADA TOMBOL HITUNG 

Private Sub cmdhitung_Click()
txtharus.Text = Val(txtjumlah.Text) * Val(txtharga.Text)
End Sub

KODE PADA TOMBOL LAGI

Private Sub cmdlagi_Click()
txtnama.Text = " "
Cmbnomor.Text = " "
txtbarang.Text = " "
txtjumlah.Text = " "
txtharga.Text = " "
txtharus.Text = " "
End Sub

KODE PADA TOMBOL SELESAI

Private Sub cmdselesai_Click()
Unload Me
End Sub

KODE UNTUK MEMUNCULKAN NO NOMOR

Private Sub Form_Load()
Cmbnomor.AddItem "44"
Cmbnomor.AddItem "55"
Cmbnomor.AddItem "66"

End Sub

Aplikasi Pemesanan 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 UNTUK MEMUNCULKAN MAKANAN

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 Penjualan Pulsa


KODE PADA KOLOM NOMINAL PEMBELIAN 

Private Sub cbonominal_Click()
If Option1.Value = True Then
Select Case cbonominal.Text
Case 5000
txtjual.Text = 6500
Case 10000
txtjual.Text = 11500
Case 20000
txtjual.Text = 21500
Case 50000
txtjual.Text = 51500
End Select
End If
If Option2.Value = True Then
Select Case cbonominal.Text
Case 5000
txtjual.Text = 7000
Case 10000
txtjual.Text = 12000
Case 20000
txtjual.Text = 22000
Case 50000
txtjual.Text = 52000
End Select
txtbayar.SetFocus
End If
End Sub

KODE PADA KOLOM NAMA OPERATOR 

Private Sub cbooperator_Click()
If cbooperator.Text = "Simpati" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "As" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Mentari" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "IM3" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Three" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Axis" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Esia" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Flexi" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Freen" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
End If

End Sub

KODE PADA TOMBOL CLEAR 

Private Sub cmdclear_Click()
cbooperator.Clear
cbonominal.Clear
Option1.Value = False
Option2.Value = False
txtjual.Text = ""
txtbayar.Text = ""
txtkembali.Text = ""
End Sub

KODE PADA TOMBOL CLOSE 


Private Sub cmdclose_Click()
pesan = MsgBox("Apakah Anda yakin ingin keluar dari Aplikasi ini?", vbYesNo + vbQuestion, "Keluar")
If pesan = vbYes Then
End
End If
End Sub

KODE PADA OPTION GSM

Private Sub Option1_Click()
If Option1.Value = True Then
cbooperator.AddItem "Simpati"
cbooperator.AddItem "As"
cbooperator.AddItem "Mentari"
cbooperator.AddItem "IM3"
cbooperator.AddItem "Three"
cbooperator.AddItem "Axis"
End If
End Sub

KODE PADA OPTION CDMA

Private Sub Option2_Click()
If Option2.Value = True Then
cbooperator.AddItem "Esia"
cbooperator.AddItem "Flexi"
cbooperator.AddItem "Freen"
End If
End Sub

KODE UNTUK HASIL MENGGUNAKAN ENTER 

Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali.Text = txtbayar.Text - txtjual.Text
Label5.Caption = " TERIMA KASIH :) "
Label5.FontSize = 12
End If

End Sub

Daftar Penjualan Alat Sekolah

KODE PADA NAMA PRODUK

Private Sub Cbonama_Click()
If Cbonama.Text = "TAS" Then
txttipe.Text = "235"
txtharga.Text = "250000000"

ElseIf Cbonama.Text = "SEPATU" Then
txttipe.Text = "567"
txtharga.Text = "300000"

ElseIf Cbonama.Text = "BUKU" Then
txttipe.Text = "987"
txtharga.Text = "15000"

ElseIf Cbonama.Text = "KOTAK PENSIL" Then
txttipe.Text = "567"
txtharga.Text = "35000"

ElseIf Cbonama.Text = "PULPEN" Then
txttipe.Text = "437"
txtharga.Text = "3000"

End If

End Sub

KODE PADA KOLOM PILIHAN WARNA 

Private Sub cbowarna_Click()
If cbowarna.Text = "MERAH" Then
ElseIf cbowarna.Text = "PUTIH" Then
ElseIf cbowarna.Text = "HITAM" Then

End If
txtjumlah.SetFocus
End Sub

KODE PADA TOMBOL LAGI 

Private Sub cmdlagi_Click()
txtpembeli.Text = ""
txtalamat.Text = ""
txtjenis.Text = ""
txtemail.Text = ""
txtnomor.Text = ""
txtkode.Text = ""
Cbonama.Text = ""
txttipe.Text = ""
cbowarna.Text = ""
txtjumlah.Text = ""
txtharga.Text = ""
txtuang.Text = ""
txttotal.Text = ""
txtpembeli.SetFocus
End Sub

KODE PADA TOMBOL PROSES

Private Sub cmdproses_Click()
txttotal.Text = Val(txtuang.Text) - Val(txtharga.Text) * Val(txtjumlah.Text)
End Sub

KODE PADA TOMBOL SELESAI 

Private Sub Cmdselesai_Click()
Unload Me
End Sub

KODE UNTUK MEMUNCULKAN PILIHAN

Private Sub Form_Load()
cbowarna.AddItem "MERAH"
cbowarna.AddItem "PUTIH"
cbowarna.AddItem "HITAM"
Cbonama.AddItem "TAS"
Cbonama.AddItem "SEPATU"
Cbonama.AddItem "BUKU"
Cbonama.AddItem "KOTAK PENSIL"
Cbonama.AddItem "PULPEN"
End Sub

KODE PADA OPTION LAKI


Private Sub Optlaki_Click()
txtjenis.Text = "LAKI-LAKI"
End Sub

KODE PADA OPTION PEREMPUAN 

Private Sub Optperempuan_Click()
txtjenis.Text = "PEREMPUAN"
End Sub

KODE HASIL MENGGUNAKAN ENTER 

Private Sub txtuang_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtuang.Text) - Val(txtharga.Text) * Val(txtjumlah.Text)
End If

End Sub

Penjualan Tiket Kereta Api

KODE PADA KOLOM JENIS KERETA

Private Sub cbokereta_Click()
If cbokereta.Text = "MELATI" Then
txtjam.Text = "10.00 WIB"
txtharga.Text = "200000"

ElseIf cbokereta.Text = "MAWAR" Then
txtjam.Text = "13.00 WIB"
txtharga.Text = "300000"

ElseIf cbokereta.Text = "LILI" Then
txtjam.Text = "15.00 WIB"
txtharga.Text = "400000"

ElseIf cbokereta.Text = "KAMBOJA" Then
txtjam.Text = "08.00 WIB"
txtharga.Text = "500000"

ElseIf cbokereta.Text = "DELIMA" Then
txtjam.Text = "09.00 WIB"
txtharga.Text = "600000"
End If
txtjumlah.SetFocus
End Sub

KODE PADA TOMBOL LAGI

Private Sub cmdlagi_Click()
txtnama.Text = ""
txtalamat.Text = ""
txtkelamin.Text = ""
txtkode.Text = ""
cbokereta.Text = ""
txtjam.Text = ""
txtharga.Text = ""
txtjumlah.Text = ""
txttotal.Text = ""
txtnama.SetFocus
End Sub

KODE PADA TOMBOL PROSES

Private Sub cmdproses_Click()
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
End Sub

KODE PADA TOMBOL SELESAI

Private Sub cmdselesai_Click()
Unload Me
End Sub

KODE UNTUK MEMUNCULKAN NAMA KERETA

Private Sub Form_Load()
cbokereta.AddItem "MELATI"
cbokereta.AddItem "MAWAR"
cbokereta.AddItem "LILI"
cbokereta.AddItem "KAMBOJA"
cbokereta.AddItem "DELIMA"
End Sub

KODE PADA OPTION LAKI-LAKI

Private Sub optlaki_Click()
txtkelamin.Text = "Laki-Laki"
End Sub

KODE PADA OPTION PEREMPUAN

Private Sub Optperempuan_Click()
txtkelamin.Text = "Perempuan"
End Sub

KODE HASIL MENGGUNAKAN ENTER

Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
End If

End Sub

Penjualan Smartphon

KOSE PADA KOLOM TIPE PRODUK

Private Sub cbotipe_Click()
If cbotipe.Text = "009" Then
txtproduk.Text = "SAMSUNG S1"
txtharga.Text = "1000000"
ElseIf cbotipe.Text = "7770" Then
txtproduk.Text = "OPPO S9"
txtharga.Text = "2500000"
ElseIf cbotipe.Text = "4560" Then
txtproduk.Text = "ADVAN"
txtharga.Text = "800000"
ElseIf cbotipe.Text = "3456" Then
txtproduk.Text = "NOKIA"
txtharga.Text = "25000000"

End If

End Sub

KODE PADA TOMBOL KELUAR 

Private Sub cmdkeluar_Click()
Unload Me
End Sub

KODE PADA TOMBOL LAGI 

Private Sub cmdlagi_Click()
txtnama.Text = ""
txtalamat.Text = ""
txtno.Text = ""
txtjenis.Text = ""
cbotipe.Text = ""
txtproduk.Text = ""
txtjumlah.Text = ""
txtharga.Text = ""
txtuang.Text = ""
txtkembalian.Text = ""
txtchk4.Text = ""
txtnama.SetFocus
End Sub

KODE PADA TOMBOL PROSES 

Private Sub cmdproses_Click()
txtkembalian.Text = Val(txtuang.Text) - Val(txtharga.Text) * Val(txtjumlah.Text)
End Sub

KODE UNTUK MEMUNCULKAN TIPE

Private Sub Form_Load()
cbotipe.AddItem "009"
cbotipe.AddItem "7770"
cbotipe.AddItem "4560"
cbotipe.AddItem "3456"

End Sub

KODE PADA OPTION LAKI-LAKI 

Private Sub optlaki_Click()
txtjenis.Text = "LAKI-LAKI"
End Sub

KODE PADA OPTION PEREMPUAN


Private Sub optperempuan_Click()
txtjenis.Text = "PEREMPUAN"
End Sub

KODE HASIL MENGGUNAKAN ENTER 

Private Sub txtuang_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembalian.Text = Val(txtuang.Text) - Val(txtharga.Text) * Val(txtjumlah.Text)
End If

End Sub