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
Sub bersih()
txtnama.Text = ""
cmbkode.Text = ""
txtjenis.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
txtharga.Text = ""
txtlama.Text = ""
txttohar.Text = ""
txtubay.Text = ""
txtukem.Text = ""
End Sub
Private Sub cmdisi_Click()
bersih
txtnama.Text = ""
cmbkode.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
txtlama.Text = ""
txtubay.Text = ""
End Sub
Private Sub cmdkeluar_Click()
X = MsgBox("Tutup Form?", vbYesNo + vbQuestion, "Konfirmasi")
If X = vbYes Then
Unload Me
End If
End Sub
Private Sub Form_Activate()
txtnama.SetFocus
txttgl.Text = Date
cmbkode.AddItem "SU01"
cmbkode.AddItem "BS01"
cmbkode.AddItem "PR01"
End Sub
Private Sub opt1_Click()
If opt1.Value = True Then
cmbkode.Text = "SU01"
txtharga.Text = 300000
ElseIf opt1.Value = True Then
cmbkode.Text = "BS01"
txtharga.Text = 500000
Else
cmbkode.Text = "PR01"
txtharga.Text = 800000
End If
End Sub
Private Sub opt2_Click()
If opt2.Value = True Then
cmbkode.Text = "SU01"
txtharga.Text = 400000
ElseIf opt2.Value = True Then
cmbkode.Text = "BS01"
txtharga.Text = 600000
Else
cmbkode.Text = "PR01"
txtharga.Text = 900000
End If
End Sub
Private Sub opt3_Click()
If opt3.Value = True Then
cmbkode.Text = "SU01"
txtharga.Text = 500000
ElseIf opt3.Value = True Then
cmbkode.Text = "BS01"
txtharga.Text = 700000
Else
cmbkode.Text = "PR01"
txtharga.Text = 1000000
End If
End Sub
Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttohar.Text = Val(txtharga.Text) * Val(txtlama)
End If
End Sub
Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtubay.Text < txttohar.Text Then
MsgBox "Uang Anda Kurang Rp. " & Val(txttohar.Text) - Val(txtubay.Text) & " Input Uang Kembali", vbOKOnly, "Warning !"
txtubay.Text = ""
txtubay.SetFocus
Else
txtukem.Text = Val(txtubay.Text) - Val(txttohar.Text)
End If
End If
End Sub
0 komentar:
Posting Komentar