Results 1 to 2 of 2
  1. #1
    brennanstice is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2011
    Posts
    1

    print individual reports for all value in a table

    Good evening all,

    So I am new to this forum. I appreciate all of the help. I have a report in that is built off a query. The criteria for that query comes from a combo box off a simple table.

    Right now the report prints out for individual values of the combo box or table. I'd like to build it so I can click a button and it prints all the values for the combo box. Is that possible? Does this make sense? Thanks again!

    B

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442

    Thumbs up

    Yes it is possible but it would require VB code to do it efficiently.

    What you would have to do is cycle through all the values in the combo box, change the value of the combo box to the next item in the list, then print the report and repeat this until you're out of items.

    Let's say you have a table called tblEmployees
    tblEmployees has three fields
    EmpID (autonumber)
    EmpFN (text)
    EmpLN (text)

    Now let's say you have a form called frmPrintInfo
    On that form you have a combo box called cmbEmployees
    where the EmpID is the bound column.

    Now say you have a report called rptEmployeeInfo that you want to print out for every employee in your database.

    this is what I would do, create a button, in the ON CLICK event of that button have something like:

    Code:
    dim db as database
    dim rst as recordset
    dim ssql as string
    
    set db = currentdb
    ssql = "SELECT * FROM tblEmployees"
    set rst = db.openrecordset(ssql)
    
    rst.movefirst
    do while rst.eof <> True
         me.cmbEmployees = rst.fields("EmpID")
         Docmd.openreport (insert your report information here)
         rst.movenext
    loop
    set db = nothing

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print query records to reports and save as pdf
    By abhay_547 in forum Programming
    Replies: 0
    Last Post: 05-09-2011, 12:00 PM
  2. Print Separate Reports with collate
    By HendriX99 in forum Reports
    Replies: 3
    Last Post: 02-04-2011, 07:46 AM
  3. Replies: 3
    Last Post: 01-25-2011, 09:50 AM
  4. Print different Reports at once
    By Brian62 in forum Reports
    Replies: 5
    Last Post: 01-21-2011, 11:19 AM
  5. Option to Print Sub-reports
    By Hotwheels59 in forum Reports
    Replies: 0
    Last Post: 06-21-2010, 03:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums