Ketentuan:
Kode Paket | Nama Paket | Besar | Sedang | Kecil |
P01 | Paket Satu | 25000 | 20000 | 15000 |
P02 | Paket Dua | 22500 | 17000 | 12000 |
Jalannya Program:
– Pilih Kode Paket , Nama Paket tampil
– Pilih Ukuran, harga Per Paket tampil, kursor berada di jumlah beli
– Masukkan jumlah Beli, PPN (10% * (harga*jumlah)& Total Tampil, kursor berada di bayar
– Masukkan Bayar, Kembali Tampil
– Jika di klik Tombol Bersih maka Semua Field kosong, Kursor berada di kode Paket
– Jika di klik tombol keluar pesan dan form tertutup.
Private Sub Form_Load()
CboKode.AddItem “P01”
CboKode.AddItem “P02”
End Sub
Private Sub CboKode_Click()
If CboKode.Text = “P01” Then
txtnama.Text = “Paket Satu”
If OptB.Value = True Then
TxtHarga.Text = 25000
ElseIf OptS.Value = True Then
TxtHarga.Text = 20000
ElseIf OptK.Value = True Then
TxtHarga.Text = 15000
Else
TxtHarga.Text = 0
End If
Else
txtnama.Text = “Paket Dua”
If OptB.Value = True Then
TxtHarga.Text = 22500
ElseIf OptS.Value = True Then
TxtHarga.Text = 17000
ElseIf OptK.Value = True Then
TxtHarga.Text = 12000
Else
TxtHarga.Text = 0
End If
End If
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Date & ” ” & Time
End Sub
Private Sub OptB_Click()
If CboKode.Text = “P01” Then
TxtHarga.Text = 25000
ElseIf CboKode.Text = “P02” Then
TxtHarga.Text = 22500
Else
TxtHarga.Text = 0
End If
TxtJumlah.SetFocus
End Sub
Private Sub Opts_Click()
If CboKode.Text = “P01” Then
TxtHarga.Text = 20000
ElseIf CboKode.Text = “P02” Then
TxtHarga.Text = 17000
Else
TxtHarga.Text = 0
End If
TxtJumlah.SetFocus
End Sub
Private Sub OptK_Click()
If CboKode.Text = “P01” Then
TxtHarga.Text = 15000
ElseIf CboKode.Text = “P02” Then
TxtHarga.Text = 12000
Else
TxtHarga.Text = 0
End If
TxtJumlah.SetFocus
End Sub
Private Sub TxtJumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtPPN.Text = 0.1 * (Val(TxtHarga.Text) * Val(TxtJumlah.Text))
TxtTotal.Text = (Val(TxtHarga.Text) *val(Txtjumlah.text))+ Val(TxtPPN.Text)
TxtBayar.SetFocus
End If
End Sub
Private Sub TxtBayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtKembali.Text = Val(TxtBayar.Text) – Val(TxtTotal.Text)
End If
End Sub
Private Sub CmdBersih_Click()
CboKode.Text = “”
txtnama.Text = “”
OptB.Value = 0
OptS.Value = 0
OptK.Value = 0
TxtHarga.Text = “”
TxtJumlah.Text = “”
TxtPPN.Text = “”
TxtTotal.Text = “”
TxtBayar.Text = “”
TxtKembali.Text = “”
CboKode.SetFocus
End Sub
Private Sub CmdKeluar_Click()
a = MsgBox(“Yakin Ingin Keluar Program ?”, vbYesNo + vbExclamation, “Konfirmasi”)
If a = 6 Then
Unload Me
End If
End Sub
amon
Februari 9, 2013 at 5:26 am
Maaf, Boleh Minta desain formnya ?
🙂