End Sub Private Sub Form_Resize
On Error Resume Next If Me.WindowState vbMinimized Then
CR1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight End If
End Sub Private Sub Form_UnloadCancel As Integer
Set cApp = Nothing Set cRep = Nothing
Call CloseRSrsCetak End Sub
Private Sub Timer1_Timer Timer1.Enabled = False
Unload Me End Sub
11. Form Laporan Pembelian Per Barang 1 frmLapBeliB1.frm
Private Sub cmdKeluar_Click Unload Me
End Sub Private Sub cmdOK_Click
If dtTglFaktur1 dtTglFaktur2 Then MsgBox Input tanggal salah , vbCritical
Exit Sub Else
dTgl1 = dtTglFaktur1.Value dTgl2 = dtTglFaktur2.Value
End If Unload Me
Unload frmLapBeliB2 frmLapBeliB2.Show
End Sub Private Sub Form_Load
dtTglFaktur1.Value = Date dtTglFaktur2.Value = Date
End Sub
12. Form Pembelian Per Barang 2 frmLapBeliB2.frm
Option Explicit REPORT - OBJECT
Private rsCetak As New ADODB.Recordset Report Recordset
Private cRep As New CRAXDDRT.Report Report Object Private cApp As New CRAXDDRT.Application Report
Application Private Sub Form_Load
Dim cF As String
Universitas Sumatera Utara
Sumber rpt Set cRep = cApp.OpenReportApp.Path
\Laporan\BeliB.rpt SQL Laporan
cF = Select B.NoFaktur, B.TglFaktur, B.KodeSupp, S.NamaSupp, B.Keterangan, _
B.TotalHarga, BD.KodeBarang, ST.NamaBarang, ST.Satuan, ST.Jenis, BD.Qty, BD.Harga, BD.SubTotal _
From TSupplier AS S INNER JOIN TBarang AS ST INNER JOIN TBeli AS B INNER JOIN TDBeli AS BD ON _
B.NoFaktur = BD.NoFaktur ON ST.KodeBarang = BD.KodeBarang ON S.KodeSupp = B.KodeSupp _
Where B.TglFaktur = FormatdTgl1, YYYY-MM- DD And B.TglFaktur = FormatdTgl2, YYYY-MM-
DD rsCetak.Open cF, oConn, adOpenStatic, adLockReadOnly,
adCmdText If rsCetak.RecordCount 0 Then
cRep.Database.SetDataSource rsCetak CR1.ReportSource = cRep
With CR1 .Left = 0: .Top = 0
.Width = Me.ScaleWidth .Height = Me.ScaleHeight
.ViewReport .Zoom 100
.Visible = True End With
Periode cRep.FormulaFields1.Text = FormatdTgl1,
ddmmyyyy sd _ FormatdTgl2,
ddmmyyyy Else
MsgBox Tidak ada data untuk dicetak , vbCritical, No Data
Timer1.Enabled = True End If
End Sub Private Sub Form_Resize
On Error Resume Next If Me.WindowState vbMinimized Then
CR1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight End If
End Sub Private Sub Form_UnloadCancel As Integer
Set cApp = Nothing Set cRep = Nothing
Call CloseRSrsCetak End Sub
Private Sub Timer1_Timer Timer1.Enabled = False
Universitas Sumatera Utara
Unload Me End Sub
13. Laporan Pembelian Per Supplier 1 frmLapBeliS1.frm