Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pemrograman – Form Jurnal Program dalam form Jurnal Dim dbf As Database Dim rstjurnal As Recordset Private Sub cmdhapus_Click() If txtaccount.Text = Empty.

Similar presentations


Presentation on theme: "Pemrograman – Form Jurnal Program dalam form Jurnal Dim dbf As Database Dim rstjurnal As Recordset Private Sub cmdhapus_Click() If txtaccount.Text = Empty."— Presentation transcript:

1 Pemrograman – Form Jurnal Program dalam form Jurnal Dim dbf As Database Dim rstjurnal As Recordset Private Sub cmdhapus_Click() If txtaccount.Text = Empty Then MsgBox "Account tdk boleh kosong!" Else With rstjurnal.Seek "=", txtnomor.Text + txtacount.Text If.NoMatch Then MsgBox "Data tidak ada!" Else.Delete MsgBox "data sudah dihapus!" End If End With hitung End If End Sub Private Sub cmdsimpan_Click() If txtaccount.Text = Empty Then MsgBox "Account tdk boleh kosong!" Else With rstjurnal.Seek "=", txtnomor.Text & txtaccount.Text If.NoMatch Then.AddNew Else

2 Private Sub Command1_Click() voucher.Enabled = True Unload Me End Sub Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) With Data1.Recordset If Not.BOF Or Not.EOF Then txtaccount.Text = !account txtket.Text = !keterangan txtdebet.Text = Str(!debet) txtkredit.Text = Str(!kredit) End If End With End Sub Private Sub Form_Load() Set dbf = OpenDatabase("c:\documents and settings\user\my documents\finance.mdb") Set rstjurnal = dbf.OpenRecordset("Jurnal", dbOpenTable) rstjurnal.Index = "jurnal1" rstjurnal.Seek "=", voucher.txtno.Text txtnomor.Text = voucher.txtno.Text If rstjurnal.NoMatch Then txtaccount.Text = "" txtket.Text = "" txtdebet.Text = 0 txtkredit.Text = 0 Else txtaccount.Text = rstjurnal!account txtket.Text = rstjurnal!keterangan txtdebet.Text = Format(rstjurnal!debet, "#,#") txtkredit.Text = Format(rstjurnal!kredit, "#,#") End If

3 End If End Sub Private Sub txtkredit_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdsimpan.SetFocus End If End Sub Latihan Tugas praktek : 1. Buat form untuk melihat isi tabel mhs1. Buatlah tombol dengan caption << untuk melihat record paling awal. Buatlah tombol dengan caption < untuk melihat record sebelumnya. Buatlah tombol dengan caption > untuk melihat record sesudahnya. Buatlah tombol dengan caption >> untuk melihat record paling akhir. Hilangkan object data dari form.


Download ppt "Pemrograman – Form Jurnal Program dalam form Jurnal Dim dbf As Database Dim rstjurnal As Recordset Private Sub cmdhapus_Click() If txtaccount.Text = Empty."

Similar presentations


Ads by Google