UTS
sih masih lama, tapi tugas buat Pra UTS dah dikasih aja. Ehm, mumpung ada libur
panjang dan gak ada janji ma yang lain. Coba-coba kerjain akh,,,
Bismillah…
Moga
gak selama yang pertama. Hihii
Penginapan
Hotel “Bobo Chiank” (ehm, hotel khusus buat bobo ciang nich J)
Ini
soalnya
Gambar
Setelah
dilihat-lihat, lets go !!!
Untuk
tampilan designya
Dan
Objek-Objek yang digunakan di Form pada propetis
Objek                                     Name                     Caption
Textbox1                              txtnip     
Textbox2                              txttgl       
Textbox3                              txtnama
Textbox4                              txtharga 
Textbox5                              txtlama  
Textbox6                              txttot      
Textbox7                              txtbayar                
Textbox8                              txtkembali            
Frame1                                 Frame1                  Data Kamar
Frame2                                 Frame2                Pembayaran
ComboBox1                        cmbkode               
CommandButton1             cmdisi                    &ISI
CommandButton2             cmdkeluar             &KELUAR
Kalau
sudah selesai, baru saya buat listingnya.
Next
untuk Listingnya
Listing
Sub aktif()
txtnama.Enabled
= True
cmbkode.Enabled
= True
opt1.Enabled
= True
opt2.Enabled
= True
opt3.Enabled
= True
txttgl.Enabled
= True
txtlama.Enabled
= True
txtbayar.Enabled
= True
End Sub
Sub bersih()
txtnama.Text
= ""
cmbkode.Text
= ""
txtjenis.Text
= ""
opt1.Value
= 0
opt2.Value
= 0
opt3.Value
= 0
txtharga.Text
= ""
txtlama.Text
= ""
txtttl.Text
= ""
txtbayar.Text
= ""
txtkembali.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
aktif
txtnama.SetFocus
cmdisi.Enabled
= True
cmdkeluar.Enabled
= True
End Sub
Private
Sub cmdkeluar_Click()
x
= MsgBox("Anda Ingin Keluar?", vbQuestion + vbYesNo,
"Konfirmasi")
If
x = vbYes Then
Unload
Me
End
If
End Sub
Private Sub
Form_activate()
bersih
aktif
txttgl
= Date
cmbkode.Text
= "Silahkan dipilih"
cmbkode.AddItem "SU01"
cmbkode.AddItem "BS01"
cmbkode.AddItem "PR01"
End Sub
Private Sub
opt1_Click()
If
opt1.Value = True Then
If cmbkode.Text = "SU01" Then
txtharga = 300000
ElseIf
cmbkode.Text = "BS01" Then
txtharga
= 500000
Else
txtharga
= 800000
End If
End
If
End Sub
Private Sub
opt2_Click()
If
opt2.Value = True Then
If cmbkode.Text = "SU01" Then
txtharga = 400000
ElseIf
cmbkode.Text = "BS01" Then
txtharga
= 600000
Else
txtharga
= 900000
End If
End
If
End Sub
Private Sub
opt3_Click()
If
opt3.Value = True Then
If cmbkode.Text = "SU01" Then
txtharga = 500000
ElseIf
cmbkode.Text = "BS01" Then
txtharga
= 700000
Else
txtharga
= 1000000
End If
End
If
End Sub
Private Sub
txtbayar_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
x
= Val(txtttl.Text) - Val(txtbayar.Text)
If Val(txtbayar.Text) <
Val(txtttl.Text) Then
MsgBox "Uang Anda Kurang Rp. "
& x, vbQuestion + vbOKOnly, "WARNING"
txtbayar.Text = ""
Else
txtkembali.Text
= Val(txtbayar.Text) - Val(txtttl.Text)
End If
End
If
End Sub
Private Sub
txtlama_KeyPress(KeyAscii As Integer)
If
KeyAscii = 13 Then
txtttl.Text
= Val(txtharga.Text) * Val(txtlama.Text)
End
If
End Sub
Ini untuk
hasilnya
Di Isi datanya
Jika Kembalinya
kurang
Keluar
Alhamdulilah,
 
Tidak ada komentar:
Posting Komentar