Thursday, April 23, 2009


Private Sub Form_Load()
cmbjenis.AddItem "umum"
cmbjenis.AddItem "executive"
cmbjenis.AddItem "VIP"
Label4.Caption = Date
End Sub

Private Sub optumum_Click()
txtumum.Text = 50000
txtspesialis.Text = ""
End Sub

Private Sub optspesialis_Click()
txtspesialis.Text = 100000
txtumum.Text = ""
End Sub


Private Sub cmbjenis_Click()
If cmbjenis.Text = "umum" Then
txtkamar.Text = 100000
Else
If cmbjenis.Text = "executive" Then
txtkamar.Text = 150000
Else
txtkamar.Text = 400000
End If
End If
txtlama.SetFocus
End Sub

Private Sub txtlama_Change()
optumum.SetFocus
End Sub

Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = (Val(txtlama.Text) * Val(txtkamar.Text)) + Val(txtumum.Text) + Val(txtspesialis.Text)
txtubay.SetFocus
End If
End Sub

Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtukem.Text = Val(txtubay.Text) - Val(txttotal.Text)
cmdisi.SetFocus
End If
End Sub

Private Sub cmdisi_Click()
txtnama.Text = ""
txtpenyakit.Text = ""
txtumum.Text = ""
txtspesialis.Text = ""
cmbjenis.Text = ""
txtkamar.Text = ""
txtlama.Text = ""
txttotal.Text = ""
txtubay.Text = ""
txtukem.Text = ""
txtnama.SetFocus
End Sub

Private Sub cmdkeluar_Click()
tama = MsgBox("apakah yakin ingin keluar", vbYesNoCancel + vbExclamation, "TANYA")
If tama = vbYes Then
Unload Me
End If
End Sub

0 komentar:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!