Download didieu yeuh
Private Sub Command1_Click()
txtno.Text = ""
txtnama.Text = ""
dckode.Text = "-pilih-"
txtjenis.Text = ""
txtharga.Text = ""
txtlama.Text = ""
txtbyr.Text = ""
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveLast
txtno.Text = Val(Adodc2.Recordset!nosewa) + 1
Else
txtno.Text = "1"
End If
txtnama.SetFocus
End Sub
Private Sub Command2_Click()
Adodc2.Recordset.AddNew
With Adodc2.Recordset
!nosewa = txtno.Text
!nmpeminjam = txtnama.Text
!kdfilm = dckode.Text
!jenis = txtjenis.Text
!harga = txtharga.Text
!lama = txtlama.Text
!bayar = txtbyr.Text
.Update
End With
MsgBox "Data Tersimpan!", vbOKOnly, "PEsan"
End Sub
Private Sub Command3_Click()
If MsgBox("Exit Now? ", vbYesNo, "Ask") = vbYes Then
End
End If
End Sub
Private Sub dckode_Click(Area As Integer)
cari = "kdfilm='" & dckode.Text & "'"
Adodc1.Recordset.Find cari, , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
txtjenis.Text = Adodc1.Recordset!jenis
End If
If txtjenis.Text = "Kartun" Then
txtharga.Text = 5000
ElseIf txtjenis.Text = "Box office" Then
txtharga.Text = 10000
Else
txtharga.Text = 6000
End If
txtlama.SetFocus
End Sub
Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtlama.Text > 7 Then
txtbyr.Text = Val(txtharga.Text) + (1000 * (txtlama.Text - 7))
Else
txtbyr.Text = txtharga.Text
End If
End If
End Sub
Private Sub txtno_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
sewa = "nosewa='" & txtno.Text & "'"
Adodc2.Recordset.Find sewa, , adSearchForward, 1
If Not Adodc2.Recordset.EOF Then
MsgBox "No Sewa Sudah Ada"
txtno.Text = ""
Else
txtnama.SetFocus
End If
End If
End Sub
Private Sub Command1_Click()
txtno.Text = ""
txtnama.Text = ""
dckode.Text = "-pilih-"
txtjenis.Text = ""
txtharga.Text = ""
txtlama.Text = ""
txtbyr.Text = ""
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveLast
txtno.Text = Val(Adodc2.Recordset!nosewa) + 1
Else
txtno.Text = "1"
End If
txtnama.SetFocus
End Sub
Private Sub Command2_Click()
Adodc2.Recordset.AddNew
With Adodc2.Recordset
!nosewa = txtno.Text
!nmpeminjam = txtnama.Text
!kdfilm = dckode.Text
!jenis = txtjenis.Text
!harga = txtharga.Text
!lama = txtlama.Text
!bayar = txtbyr.Text
.Update
End With
MsgBox "Data Tersimpan!", vbOKOnly, "PEsan"
End Sub
Private Sub Command3_Click()
If MsgBox("Exit Now? ", vbYesNo, "Ask") = vbYes Then
End
End If
End Sub
Private Sub dckode_Click(Area As Integer)
cari = "kdfilm='" & dckode.Text & "'"
Adodc1.Recordset.Find cari, , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
txtjenis.Text = Adodc1.Recordset!jenis
End If
If txtjenis.Text = "Kartun" Then
txtharga.Text = 5000
ElseIf txtjenis.Text = "Box office" Then
txtharga.Text = 10000
Else
txtharga.Text = 6000
End If
txtlama.SetFocus
End Sub
Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtlama.Text > 7 Then
txtbyr.Text = Val(txtharga.Text) + (1000 * (txtlama.Text - 7))
Else
txtbyr.Text = txtharga.Text
End If
End If
End Sub
Private Sub txtno_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
sewa = "nosewa='" & txtno.Text & "'"
Adodc2.Recordset.Find sewa, , adSearchForward, 1
If Not Adodc2.Recordset.EOF Then
MsgBox "No Sewa Sudah Ada"
txtno.Text = ""
Else
txtnama.SetFocus
End If
End If
End Sub
Posting Komentar