hallo mas vbPian,
wahhh bener2 repot ya kerja sama report crystal.
masih error jg tuh mas. errornya " Invalid Name"
ini koding yg aku pake.
salam
lis
'---------------------------------------------------
Dim cnBal As New ADODB.Connection
Dim rsBal As New ADODB.Recordset
Dim crBalance As New CRAXDRT.Application
Dim crDatabase As CRAXDRT.Database
Dim sStr As String
Dim sSQL As String
Private Sub Form_Load()
With cnBal
.Provider = "Microsoft.Jet.OleDB.4.0"
.CursorLocation = adUseClient
.Open App.Path & "\GL.mdb"
End With
sSQL = "SELECT Acc3.kode3, Acc3.nama3, Closing.periode, Closing.saldo FROM
Acc3 INNER JOIN
Closing ON Acc3.kode3 = Closing.kode3 "
rsBal.Open sSQL, cnBal, adOpenStatic, adLockOptimistic
Set Report = crBalance.OpenReport(App.Path & "\report\rptNeraca.rpt")
Set crDatabase = Report.Database
crDatabase.SetDataSource rsBal, 3, 1
'sStr = "{Closing.periode} = IN #" & frmSelectBal.date1.Value & "# TO #" &
frmSelectBal.date2.Value & "#"
'Report.RecordSelectionFormula = sstr
'---ini kode yg sy paste dari mas vbPian
Report.FormulaFields.GetItemByName("tglAwal") = "{Closing. periode}> =Date(" &
Year(frmSelectBal.date1.Value) & ", " & Month(frmSelectBal.date1.Value) & ", " &
Day(frmSelectBal.date1.Value) & ")"
Report.FormulaFields.GetItemByName("tglAkhir") = "{Closing. periode}< =Date(" &
Year(frmSelectBal.date2.Value) & ", " & Month(frmSelectBal.date2.Value) & ", " &
Day(frmSelectBal.date2.Value) & ")"
Report.DiscardSavedData
crBal.ReportSource = Report
crBal.ViewReport
Set rsBal = Nothing
Set cnBal = Nothing
End Sub
Private Sub Form_Resize()
With crBal
.Top = 0
.Left = 0
.Height = ScaleHeight
.Width = ScaleWidth
End With
End Sub
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front