Kode Program Combo Box Nomor Barang :
Private Sub cbonomor_Click()
If cbonomor.Text = "1" Then
txtbarang.Text = "sabun"
txtharga.Text = "2000"
ElseIf cbonomor.Text = "2" Then
txtbarang.Text = "rinso"
txtharga.Text = "1000"
ElseIf cbonomor.Text = "3" Then
txtbarang.Text = "shampo"
txtharga.Text = "3000"
ElseIf cbonomor.Text = "4" Then
txtbarang.Text = "pena"
txtharga.Text = "4000"
End If
txtjumlah.SetFocus
End Sub
Kode Sub Form Load :
Private Sub Form_Load()
cbonomor.AddItem "1"
cbonomor.AddItem "2"
cbonomor.AddItem "3"
cbonomor.AddItem "4"
End Sub
Kode Program Tombol Hitung :
Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
End Sub
Kode Program Tombol Hitung Lagi :
Private Sub cmdhitunglagi_Click()
txtnama.Text = " "
cbonomor.Text = " "
txtbarang.Text = " "
txtharga.Text = " "
txtjumlah.Text = " "
txtbayar.Text = " "
txtnama.SetFocus
End Sub
Kode Program Tombol Selesai :
Private Sub cmdselesai_Click()
Unload Me
End Sub
Tidak ada komentar:
Posting Komentar