×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

creating a report to show multiple invoices

creating a report to show multiple invoices

creating a report to show multiple invoices

(OP)
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





  

RE: creating a report to show multiple invoices

Hmmm...

Try creating a Control Array for the Crystal Viewer control?  Then ".load" one for each invoice in your Do..Loop.  

Put the ".viewReport" in this loop too.  This will bring up a window for each invoice.

Not sure that helps you!  Haven't dealt with such things for a while!  

Let me know!  Bobbber.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close