SELAMAT DATANG

Kamis, 14 April 2011

form penjualan


Private Sub cinput_Click()
aktif
bersih
End Sub

Private Sub ckeluar_Click()
If MsgBox("yakin lu mau keluar", vbYesNo + vbQuestion, "informasi") Then End
End Sub

Private Sub Combo1_Click()
Select Case Combo1.Text
Case "B-001"
tnama.Text = "Pasta Gigi"
tharga.Text = 7000
Case "B-002"
tnama.Text = "Obat Kumur"
tharga.Text = 15000
Case "B-003"
tnama.Text = "SikatGigi"
tharga.Text = 3000
End Select
End Sub



Private Sub Form_Load()
Combo1.AddItem "B-001"
Combo1.AddItem "B-002"
Combo1.AddItem "B-003"
nonaktif
End Sub

Private Sub ogold_Click()
tpot.Text = Val(tharga.Text) * 0.1
End Sub

Private Sub osilver_Click()
tpot.Text = Val(tharga.Text) * 0.05
End Sub

Private Sub tbeli_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ttotal.Text = Val(tbeli.Text * (tharga.Text - tpot.Text))
End If
End Sub

Sub aktif()
Dim x As Control
For Each x In Me
If TypeOf x Is TextBox Then x.Enabled = True
If TypeOf x Is ComboBox Then x.Enabled = True
If TypeOf x Is OptionButton Then x.Value = True
Next
End Sub

Sub nonaktif()
Dim x As Control
For Each x In Me
If TypeOf x Is TextBox Then x.Enabled = False
If TypeOf x Is ComboBox Then x.Enabled = False
If TypeOf x Is OptionButton Then x.Value = False
Next
End Sub

Sub bersih()
Dim x As Control
For Each x In Me
If TypeOf x Is TextBox Then x.Text = ""
If TypeOf x Is ComboBox Then x.Text = ""
If TypeOf x Is OptionButton Then x.Value = False
If TypeOf x Is OptionButton Then x.Enabled = True
Next
End Sub

Selamat Mencoba :D

Tidak ada komentar:

Posting Komentar