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