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
Tidak ada komentar:
Posting Komentar