Hi Guys my name is tejas m having the same problem i am trying to compile a billing project but it wont simply work gives Unhandled exception in SPBS.EXE(Program Name) (CRAXDRT.DLL) Access Violation 0xc some zeros and 5 i am posting the complete code of frmreports can anyone help me to figure out what's wrong i am new to programming
***********************here is the code
Option Explicit
Public strReport As String
Public PK As String
Public strYear As String
Public blnPaid As Boolean
Public strWhere As String
Dim mTest As CRAXDRT.Application
Dim mReport As CRAXDRT.Report
Dim SubReport As CRAXDRT.Report
Dim mParam As CRAXDRT.ParameterFieldDefinitions
Public Sub CommandPass(ByVal srcPerformWhat As String)
Select Case srcPerformWhat
Case "Close"
Unload Me
End Select
End Sub
Private Sub Form_Load()
On Error GoTo err_Form_Load
Dim mSubRep
Set mTest = New CRAXDRT.Application
Set mReport = New CRAXDRT.Report
Select Case strReport
Case "Customer Ledger"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Customer_Ledger.rpt")
mReport.RecordSelectionFormula = strWhere
Case "Collections"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Collections.rpt")
Case "Receivables"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Receivables.rpt")
Case "Payments"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Payments.rpt")
mReport.RecordSelectionFormula = "{Payments.PaymentID} = " & PK
Case "Subscription Details"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Subscription_Details.rpt")
mReport.RecordSelectionFormula = "{qry_Subscription_Details.SubscriberNo} = '" & PK & "'"
Case "Customers Report" 'Subscribers List
Set mReport = mTest.OpenReport(App.Path & "rpt_Customers.rpt")
mReport.RecordSelectionFormula = strWhere
Set mParam = mReport.ParameterFields
If frmRPTCustomers.Option1(2).Value = True Then
mParam.Item(1).AddCurrentValue "Status: Disconnected"
Else
mParam.Item(1).AddCurrentValue ""
End If
Case "Overall Subscriber Summary"
Set mReport = mTest.OpenReport(App.Path & "rpt_Overall_Subscriber_Summary.rpt")
mReport.RecordSelectionFormula = "{Subscription_Details.InstallationDate} <= #" & strWhere & "#"
Set SubReport = mReport.OpenSubreport("Type")
SubReport.RecordSelectionFormula = "{qry_Subscriber_Summary_by_Type.InstallationDate} <= #" & strWhere & "#"
Set mParam = mReport.ParameterFields
mParam.Item(1).AddCurrentValue CDate(strWhere)
Case "Billing"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Billing.rpt")
Set mParam = mReport.ParameterFields
Dim dDateIssued As Date
dDateIssued = frmRPTBilling.dtpDate
mReport.RecordSelectionFormula = strWhere
mParam.Item(1).AddCurrentValue DateSerial(Year(dDateIssued), Month(dDateIssued) + 1, 0)
mParam.Item(2).AddCurrentValue dDateIssued
Case "Monthly Subscriber Summary"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Monthly_Subs_Sum.rpt")
Set mParam = mReport.ParameterFields
'New Subscriber
Set SubReport = mReport.OpenSubreport("NewSubscriber")
SubReport.RecordSelectionFormula = "{qry_RPT_New_Subscriber.InstallationDate} IN " & strWhere
'Reconnection
Set SubReport = mReport.OpenSubreport("Reconnected")
SubReport.RecordSelectionFormula = "{qry_RPT_Reconnected.ReconnectionDate} IN " & strWhere
'Disconnection
Set SubReport = mReport.OpenSubreport("Disconnected")
SubReport.RecordSelectionFormula = "{qry_RPT_Disconnected.DisconnectionDate} IN " & strWhere
mParam.Item(1).AddCurrentValue frmRPTMonthlySubsSum.dtpBegDate.Value
mParam.Item(2).AddCurrentValue frmRPTMonthlySubsSum.dtpEndDate.Value
Case "Collection Summary"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Collection_Summary.rpt")
Set mParam = mReport.ParameterFields
mReport.RecordSelectionFormula = strWhere
mParam.Item(1).AddCurrentValue frmRPTCollSum.dtpBegDate.Value
mParam.Item(2).AddCurrentValue frmRPTCollSum.dtpEndDate.Value
Case "Disbursement Summary"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Disbursement_Summary.rpt")
Set mParam = mReport.ParameterFields
mReport.RecordSelectionFormula = strWhere
mParam.Item(1).AddCurrentValue frmRPTDisburseSum.dtpBegDate.Value
mParam.Item(2).AddCurrentValue frmRPTDisburseSum.dtpEndDate.Value
Case "Statement of Income and Expenses"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Income_and_Expenses.rpt")
Set mParam = mReport.ParameterFields
'New Subscriber
Set SubReport = mReport.OpenSubreport("Revenues")
SubReport.RecordSelectionFormula = "{qry_RPT_Revenues.PaymentDate} IN " & strWhere
'Reconnection
Set SubReport = mReport.OpenSubreport("OperatingExpenses")
SubReport.RecordSelectionFormula = "{qry_RPT_Operating_Expenses.Date} IN " & strWhere
'Disconnection
Set SubReport = mReport.OpenSubreport("Refund")
SubReport.RecordSelectionFormula = "{qry_RPT_Refund.PaymentDate} IN " & strWhere
mParam.Item(1).AddCurrentValue frmRPTStatementIncExp.dtpBegDate.Value
mParam.Item(2).AddCurrentValue frmRPTStatementIncExp.dtpEndDate.Value
Case "Disbursement History"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Disbursement_History.rpt")
mReport.RecordSelectionFormula = "{Voucher.VoucherID} = " & PK
Case "Subscriber Per Month"
Set mReport = mTest.OpenReport(App.Path & "\Reports\rpt_Subscriber_Per_Month.rpt")
End Select
Screen.MousePointer = vbHourglass
CR.ReportSource = mReport
CR.ViewReport
Screen.MousePointer = vbDefault
Exit Sub
err_Form_Load:
prompt_err err, Name, "Form_Load"
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
With CR
.Top = 0
.Left = 0
.Height = ScaleHeight
.Width = ScaleWidth
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
mdiMain.RemoveChild Me.Name
Set frmReports = Nothing
End Sub
******************************************** end of code *************
thanks in advance for reply