vb1/toko oli & service

toko oli & service

LISTING : 

Private Sub cmdbaru_Click()
bersih
aktif
tkode.SetFocus
End Sub

Private Sub cmdkeluar_Click()
p = MsgBox(“yakin ingin keluar?”, vbQuestion + vbOKCancel, “INFO”)
If p = vbOK Then
Unload Me
End If
End Sub


Sub bersih()
tkode.Text = “”
tmerk.Text = “”
tharga.Text = “”
tbiser.Text = “”
tjumbel.Text = “”
ttohar.Text = “”
tppn.Text = “”
ttobay.Text = “”
tubay.Text = “”
tukem.Text = “”
omobil.Value = False
omotor.Value = False
End Sub

Sub aktif()
tkode.Enabled = True
tjumbel.Enabled = True
tubay.Enabled = True
omobil.Enabled = True
omotor.Enabled = True

End Sub

Sub nonaktif()
tkode.Enabled = False
tmerk.Enabled = False
tharga.Enabled = False
tjumbel.Enabled = False
ttohar.Enabled = False
tppn.Enabled = False
ttobay.Enabled = False
tubay.Enabled = False
tukem.Enabled = False
tbiser.Enabled = False
omobil.Enabled = False
omotor.Enabled = False
End Sub
Private Sub Form_Activate()
bersih
nonaktif
End Sub
Private Sub omobil_Click()
tbiser.Text = 50000
tjumbel.SetFocus
End Sub

Private Sub omotor_Click()
tbiser.Text = 25000
tjumbel.SetFocus
End Sub

Private Sub tjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ttohar.Text = Val(tharga.Text) * Val(tjumbel.Text) + Val(tbiser.Text)
tppn.Text = 0.1 * Val(ttohar.Text)
ttobay.Text = Val(ttohar.Text) + Val(tppn.Text)
tubay.SetFocus
End If
End Sub

Private Sub tkode_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
Select Case tkode.Text
Case “P”
tmerk.Text = “Penzoil”
tharga.Text = 40000
Case “A”
tmerk.Text = “Agip”
tharga.Text = 35000
Case “T”
tmerk.Text = “Top1”
tharga.Text = 30000
Case “M”
tmerk.Text = “Mesran”
tharga.Text = 28000
Case “E”
tmerk.Text = “Enduro”
tharga.Text = 25000
End Select
End If
End Sub
Private Sub tubay_Change()
tukem.Text = Val(tubay.Text) – Val(ttobay.Text)
End Sub

setelah form di ruuning :

 

ketentuan :

 1. tombol transaksi baru di klik maka form dalam keadaan bersih.

2. kode oli di isi maka merk oli & harga oli tampil otomatis.

3. tombol keluar dengan mesagge box.

Leave a comment