Tugas
ke 3, Pra UTS 3
Ini
yang paling susah, karena harus membuat design sendiri. Mana otak lagi hang…
Buat
yang standar-standar aja akh, yang penting selesai J
Buat
form apotik (dah banyak), form Koran (duh bingung euy)
Jadinya
buat form pembelian Kosmetik aja,,, ngikutin tugas disemester-semester
sebelumnya…
Designnya
seperti ini
Ini
memudahkan kasir untuk menghitung apa saja yang dibeli para konsumen saat itu.
Konsumen bisa membeli apa saja (produk yang dijual) dan itemnya yang berapa
saja.
Setelah
memasukan transaksi, sebenarnya bisa langsung di cetak. Tapi apadaya, ilmunya
belum sampai tombol cetak. Mohon maklum kalau terlihat tidak menarik. Otak dah
kehabisan ide
Selamat
mengikuti untuk design program penjualan kosmetik
Designnya
Objek Name Caption
Textbox1 txtnama
Textbox2 txttgl
Textbox3 txtjenis1
Textbox4 txtjenis2
Textbox5 txtjenis3
Textbox6 txtnama1
Textbox7 txtnama2
Textbox8 txtnama3
Textbox9 txtharga1
Textbox10 txtharga2
Textbox11 txtharga3
Textbox12 txtbeli1
Textbox13 txtbeli2
Textbox14 txtbeli3
Textbox15 txtjml1
Textbox16 txtjml2
Textbox17 txtjml3
Textbox18 txttot
Textbox19 txtppn
Textbox20 txttobay
Textbox21 txtbayar
Textbox22 txtkembali
Frame1 Frame1 Bedak
Frame2 Frame2 Cream
Frame3 Frame3 Parfum
Frame4 Frame4 Pembayaran
Frame4 Frame4 Hadiah
ComboBox1 cmbkode
ComboBox2 cmbkode1
ComboBox3 cmbkode2
ComboBox4 cmbkode3
CommandButton1 cmdinput &INPUT
CommandButton2 cmdkeluar &KELUAR
Untuk
Listingnya
Listing
Sub aktif()
cmbkode.Enabled
= True
cmbkode1.Enabled
= True
txtbeli1.Enabled
= True
cmbkode2.Enabled
= True
txtbeli2.Enabled
= True
cmbkode3.Enabled
= True
txtbeli3.Enabled
= True
txtbayar.Enabled
= True
End Sub
Sub bersih()
cmbkode.Text
= ""
txtnama.Text
= ""
cmbkode1.Text
= ""
txtbeli1.Text
= ""
txtjenis1.Text
= ""
txtnama1.Text
= ""
txtharga1.Text
= ""
txtjml1.Text
= ""
cmbkode2.Text
= ""
txtbeli2.Text
= ""
txtjenis2.Text
= ""
txtnama2.Text
= ""
txtharga2.Text
= ""
txtjml2.Text
= ""
cmbkode3.Text
= ""
txtbeli3.Text
= ""
txtjenis3.Text
= ""
txtnama3.Text
= ""
txtharga3.Text
= ""
txtjml3.Text
= ""
txttot.Text
= ""
txtppn.Text
= ""
txttobay.Text
= ""
txtbayar.Text
= ""
txtkembali.Text
= ""
lblhadiah.Caption
= ""
End Sub
Private Sub
cmbkode_Click()
If
cmbkode.Text = "01AR" Then
txtnama.Text
= "Ariyanti"
ElseIf cmbkode.Text = "02TW" Then
txtnama.Text = "Tiwi"
Else
txtnama.Text = "Sari"
End
If
End Sub
Private Sub
cmbkode1_Click()
If
cmbkode1.Text = "B01" Then
txtjenis1.Text
= "Padat"
txtnama1.Text
= "Maybeline"
txtharga1.Text
= 35000
ElseIf cmbkode1.Text = "B02"
Then
txtjenis1.Text = "Tabur"
txtnama1.Text = "Marina"
txtharga1.Text = 25000
Else
txtjenis1.Text = "Padat spv
30"
txtnama1.Text = "Maybeline"
txtharga1.Text = 47000
End
If
txtbeli1.SetFocus
End Sub
Private Sub
cmbkode2_Click()
If
cmbkode2.Text = "C01" Then
txtjenis2.Text
= "Anti Agni"
txtnama2.Text
= "Olay"
txtharga2.Text
= 75000
ElseIf cmbkode2.Text = "C02"
Then
txtjenis2.Text = "Anti Acne"
txtnama2.Text = "Ponds"
txtharga2.Text = 20000
Else
txtjenis2.Text = "Noda Hitam"
txtnama2.Text = "Garnier"
txtharga2.Text = 15000
End
If
txtbeli2.SetFocus
End Sub
Private Sub
cmbkode3_Click()
If
cmbkode3.Text = "P01" Then
txtjenis3.Text
= "Women"
txtnama3.Text
= "Paris Hilton"
txtharga3.Text
= 125000
ElseIf cmbkode3.Text = "P02"
Then
txtjenis3.Text = "Man"
txtnama3.Text = "Giordano"
txtharga3.Text = 350000
Else
txtjenis3.Text = "Teen"
txtnama3.Text = "She 100ml"
txtharga3.Text = 18000
End
If
txtbeli3.SetFocus
End Sub
Private Sub
cmdinput_Click()
bersih
aktif
cmbkode.SetFocus
End Sub
Private Sub
cmdkeluar_Click()
X
= MsgBox("Anda Ingin Keluar?", vbQuestion + vbYesNo,
"Konfirmasi")
If
X = vbYes Then
Unload
Me
End
If
End Sub
Private Sub
form_activate()
bersih
aktif
txttgl.Text
= Date
cmbkode.AddItem
"01AR"
cmbkode.AddItem
"02TW"
cmbkode.AddItem
"03SR"
cmbkode1.Text
= "pilih"
cmbkode1.AddItem
"B01"
cmbkode1.AddItem
"B02"
cmbkode1.AddItem
"B03"
cmbkode2.Text
= "pilih"
cmbkode2.AddItem
"C01"
cmbkode2.AddItem
"C02"
cmbkode2.AddItem
"C03"
cmbkode3.Text
= "pilih"
cmbkode3.AddItem
"P01"
cmbkode3.AddItem
"P02"
cmbkode3.AddItem
"P03"
cmdinput.Enabled
= True
cmdkeluar.Enabled
= True
End Sub
Private Sub
txtbayar_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
If Val(txtbayar.Text) <
Val(txttobay.Text) Then
MsgBox "Uang Anda Kurang",
vbQuestion + vbOKOnly, "WARNING"
txtbayar.Text = ""
Else
txtkembali.Text
= Val(txtbayar.Text) - Val(txttobay.Text)
End If
End
If
End Sub
Private Sub
txtbeli1_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
txtjml1.Text
= Val(txtbeli1.Text) * Val(txtharga1.Text)
End
If
End Sub
Private Sub
txtbeli2_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
txtjml2.Text
= Val(txtbeli2.Text) * Val(txtharga2.Text)
End
If
End Sub
Private Sub
txtbeli3_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
txtjml3.Text
= Val(txtbeli3.Text) * Val(txtharga3.Text)
End
If
End Sub
Private Sub
txttot_Click()
txttot.Text
= Val(txtjml1.Text) + Val(txtjml2.Text) + Val(txtjml3.Text)
txtppn.Text
= 0.1 * Val(txttot.Text)
txttobay.Text
= Val(txttot.Text) + Val(txtppn.Text)
If
txttobay.Text > 100000 Then
lblhadiah.Caption
= " Boneka Lucu"
Else
lblhadiah.Caption = "Belum dapat
hadiah"
End
If
End Sub
Jreng Jreng
Jreng Hasilnya
Untuk Keluar
Alhamdulilah semua selesai juga....
Tidak ada komentar:
Posting Komentar