KODE KOLOM COMBO PADA NAMA PRODUK
Private Sub CboPilih_Click()
If CboPilih.Text = "Mouse" Then
TxtHarga.Text = "15000"
ElseIf CboPilih.Text = "Keyboard" Then
TxtHarga.Text = "30000"
ElseIf CboPilih.Text = "CPU" Then
TxtHarga.Text = "10000"
End If
TxtJumlah.SetFocus
End Sub
KODE TOMBOL HITUNG
Private Sub CmdHitung_Click()
TxtTotal.Text = Val(TxtUang.Text) - Val(TxtHarga.Text) *
Val(TxtJumlah.Text)
End Sub
KODE TOMBOL BELI LAGI
Private Sub CmdLagi_Click()
TxtID.Text = ""
TxtNama.Text = ""
TxtAlamat.Text = ""
TxtNo.Text = ""
CboPilih.Text = ""
TxtHarga.Text = ""
TxtJumlah.Text = ""
TxtUang.Text = ""
TxtTotal.Text = ""
TxtID.SetFocus
End Sub
KODE TOMBOL SELESAI
Private Sub CmdSelesai_Click()
Unload Me
End Sub
KODE UNTUK MEMUNCULKAN PILIHAN PRODUK
Private Sub Form_Load()
CboPilih.AddItem "Mouse"
CboPilih.AddItem "Keyboard"
CboPilih.AddItem "CPU"
End Sub
Tidak ada komentar:
Posting Komentar