Hi
Im kind of new with Crystal Reports and Im trying to create a report that will generate multiple invoice reports based on a job number that a user will input, but with my code Im only getting the last invoice report to print in the recordset that I want to show the multiple invoices for. Here is the code that I have so far.
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Call Connect
CRViewer1.ReportSource = Report
Dim adoConn As ADODB.Connection
Dim rsInvoiceReports As ADODB.Recordset
Set adoConn = CreateObject("ADODB.Connection"
Set rsInvoiceReports = CreateObject("ADODB.Recordset"
adoConn.Open DSNAbsToolsInvoicing, DSNAbsToolsInvoicingUsername, DSNAbsToolsInvoicingPassword
SQL = "Select InvoiceId from tblInvoice Inner Join tbljob on tbljob.jobid = tblinvoice.fjobid "
SQL = SQL & " where Job_No = " & IntInvoiceReportJobId
SQL = SQL & " and tblJob.activeflag = 1 and tblInvoice.activeflag = 1"
rsInvoiceReports.Open SQL, adoConn, adOpenStatic
Dim InvoiceCount As Integer
InvoiceCount = 1
Do Until rsInvoiceReports.EOF
Report.ParameterFields(InvoiceCount).AddCurrentValue (CInt(rsInvoiceReports("InvoiceId"))
InvoiceCount = InvoiceCount + 1
rsInvoiceReports.MoveNext
Loop
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Me.WindowState = 2
Im kind of new with Crystal Reports and Im trying to create a report that will generate multiple invoice reports based on a job number that a user will input, but with my code Im only getting the last invoice report to print in the recordset that I want to show the multiple invoices for. Here is the code that I have so far.
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Call Connect
CRViewer1.ReportSource = Report
Dim adoConn As ADODB.Connection
Dim rsInvoiceReports As ADODB.Recordset
Set adoConn = CreateObject("ADODB.Connection"
Set rsInvoiceReports = CreateObject("ADODB.Recordset"
adoConn.Open DSNAbsToolsInvoicing, DSNAbsToolsInvoicingUsername, DSNAbsToolsInvoicingPassword
SQL = "Select InvoiceId from tblInvoice Inner Join tbljob on tbljob.jobid = tblinvoice.fjobid "
SQL = SQL & " where Job_No = " & IntInvoiceReportJobId
SQL = SQL & " and tblJob.activeflag = 1 and tblInvoice.activeflag = 1"
rsInvoiceReports.Open SQL, adoConn, adOpenStatic
Dim InvoiceCount As Integer
InvoiceCount = 1
Do Until rsInvoiceReports.EOF
Report.ParameterFields(InvoiceCount).AddCurrentValue (CInt(rsInvoiceReports("InvoiceId"))
InvoiceCount = InvoiceCount + 1
rsInvoiceReports.MoveNext
Loop
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Me.WindowState = 2