ini listing program nya :O
Sub aktif()
txtnama.Enabled = True
cmbkode.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
txtlama.Enabled = True
txtubay.Enabled = True
End Sub
Sub nonaktif()
txtnama.Enabled = False
txttgl.Enabled = False
cmbkode.Enabled = False
txtjenis.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
txtsewa.Enabled = False
txtlama.Enabled = False
txttotal.Enabled = False
txtubay.Enabled = False
txtukem.Enabled = False
End Sub
Sub bersih()
txtnama.Text = ""
cmbkode.Text = ""
txtjenis.Text = ""
Option1.Value = 0
Option2.Value = 0
Option3.Value = 0
txtsewa.Text = ""
txtlama.Text = ""
txttotal.Text = ""
txtubay.Text = ""
txtukem.Text = ""
End Sub
Private Sub cmbkode_Click()
If cmbkode.Text = "SU01" Then
txtjenis.Text = "Suite"
ElseIf cmbkode.Text = "BS01" Then
txtjenis.Text = "Bussines"
Else
txtjenis.Text = "President"
End If
End Sub
Private Sub cmdisi_Click()
bersih
txtnama.SetFocus
cmbkode.Text = "-Pilih-"
cmdisi.Enabled = True
cmdkeluar.Enabled = True
End Sub
Private Sub Form_Activate()
aktif
cmbkode.AddItem "SU01"
cmbkode.AddItem "BS01"
cmbkode.AddItem "PR01"
txttgl.Text = Date
cmdisi.Enabled = True
cmdkeluar.Enabled = True
End Sub
Private Sub Option1_Click()
If txtjenis.Text = "Suite" Then
txtsewa.Text = 300000
ElseIf txtjenis.Text = "Bussines" Then
txtsewa.Text = 500000
ElseIf txtjenis.Text = "President" Then
txtsewa.Text = 800000
End If
End Sub
Private Sub Option2_Click()
If txtjenis.Text = "Suite" Then
txtsewa.Text = 400000
ElseIf txtjenis.Text = "Bussines" Then
txtsewa.Text = 600000
ElseIf txtjenis.Text = "President" Then
txtsewa.Text = 900000
End If
End Sub
Private Sub Option3_Click()
If txtjenis.Text = "Suite" Then
txtsewa.Text = 500000
ElseIf txtjenis.Text = "Bussines" Then
txtsewa.Text = 700000
ElseIf txtjenis.Text = "President" Then
txtsewa.Text = 1000000
End If
End Sub
Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtsewa.Text) * Val(txtlama.Text)
txtubay.SetFocus
End If
End Sub
Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = Val(txttotal.Text) - Val(txtubay.Text)
If txtubay.Text < txttotal.Text Then
MsgBox "uang anda kurang" & a, vbOKOnly, "WARNING!"
txtubay.Text = ""
txtubay.SetFocus
Else
txtukem.Text = Val(txtubay.Text) - Val(txttotal.Text)
End If
End If
End Sub
Private Sub cmdkeluar_Click()
a = MsgBox("Tutup Form?", vbYesNo + vbQuestion, "Konfirmasi")
If a = vbYes Then
Unload Me
End If
End Sub



Tidak ada komentar:
Posting Komentar