If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
New file for each report printed
Hi everybody,
When I print out the report, how I can separate each record on one page?? For example: I have a database that generates a report for each employee with a detail information about his customers, when I want to print out reports on my desktop it is printed as one file instead of separate files for each employee. How I can generate separate report for each employee??? Thanks very much |
#2
|
|||
|
|||
New file for each report printed
How are you opening the report? You can use VBA to loop through the criteria
and run the report individually for each employee, similar to the following: Dim rs as new ADODB.Recordset Dim cnx as ADODB.Connection Dim strSQL as String Dim strEmp as String Set cnx = CurrentProject.Connection strSQL = "SELECT * From YourTable" rs.Open strSQL,cnx, adOpenKeyset, adLockOptimistic, adCmdText If rs.RecordCount 0 Then rs.MoveFirst Do While Not rs.EOF strEmp = rs.Fields("EmployeeName").Value DoCmd.OpenReport "YourEmployeeReport", acViewPreview, , "EmployeeName = '" & strEmp & "'" rs.MoveNext Loop End If rs.Close Set rs = Nothing If you want to sent the reports directly to the printer, change acViewPreview to acViewNormal. If you prefer to save the reports to a file, change the DoCmd.OpenReport line to: Snapshot format: DoCmd.OutputTo acReport, "YourEmployeeReport", "SnapshotFormat(*.snp)", "C:\YourFolder\YourReport.snp", True Word format(RichText file): DoCmd.OutputTo acReport, "YourEmployeeReport", acFormatRTF, "C:\YourFolder\YourReport.doc", True Note that rich text docs will not contain images, and checkboxes will not appear, as rtf doesn't support graphics. -- hth, SusanV "Youngpioneer" wrote in message ... Hi everybody, When I print out the report, how I can separate each record on one page?? For example: I have a database that generates a report for each employee with a detail information about his customers, when I want to print out reports on my desktop it is printed as one file instead of separate files for each employee. How I can generate separate report for each employee??? Thanks very much |
#3
|
|||
|
|||
New file for each report printed
First of all, thanks very much for your reply,
The solution was great, but still I have only one question: Could I extract it as a PDF format? |
#4
|
|||
|
|||
New file for each report printed
Not that I'm aware of - Access doesn't support pdf files natively. You can
use CutePDF to print to a PDF, but I'm not sure you can get the loop to work properly with needing the input for the file save location - I've never tried. I was able to find this old thread which may help you: http://groups.google.com/group/micro...6e8422133f2bd3 link may wrap Good luck! Susan "Youngpioneer" wrote in message ... First of all, thanks very much for your reply, The solution was great, but still I have only one question: Could I extract it as a PDF format? |
#5
|
|||
|
|||
New file for each report printed
Your care about my problem is highly appreciated by me. I would like to thank
you very much for your help |
#6
|
|||
|
|||
New file for each report printed
Hi again, still I have one problem for this issue. The problem is that for
every record (I mean for every employee) a dialogue will appear again for me and it will ask about where I want to save my report and what the name for my file is. I do not want it to appear. Instead, I want to click one bottom and reports will be saved automatically with ID for the employee?? |
#7
|
|||
|
|||
New file for each report printed
Susan, Can something similar be done for a query based report that is grouped
by location? I have a report that the location header is grouped and forces a new page "before section". I would like to be able to print this big report into separate pdf files based on the location header. I do have pdf printer capability. I appreciate any assistance you can offer. Right now I'm stumped on how to get this done in a less time consuming manner. ~Rhonda "SusanV" wrote: Not that I'm aware of - Access doesn't support pdf files natively. You can use CutePDF to print to a PDF, but I'm not sure you can get the loop to work properly with needing the input for the file save location - I've never tried. I was able to find this old thread which may help you: http://groups.google.com/group/micro...6e8422133f2bd3 link may wrap Good luck! Susan "Youngpioneer" wrote in message ... First of all, thanks very much for your reply, The solution was great, but still I have only one question: Could I extract it as a PDF format? |
#8
|
|||
|
|||
New file for each report printed
I can tell you how I did this. It ain't pretty but it works. I built my
report on a query that gets a parameter from a screen. I loop through my parameters placing them on the screen and then exporting them to PDF. Southern engineering at it's finest but it works. GrimesRL wrote: Susan, Can something similar be done for a query based report that is grouped by location? I have a report that the location header is grouped and forces a new page "before section". I would like to be able to print this big report into separate pdf files based on the location header. I do have pdf printer capability. I appreciate any assistance you can offer. Right now I'm stumped on how to get this done in a less time consuming manner. ~Rhonda "SusanV" wrote: Not that I'm aware of - Access doesn't support pdf files natively. You can use CutePDF to print to a PDF, but I'm not sure you can get the loop to work properly with needing the input for the file save location - I've never tried. I was able to find this old thread which may help you: http://groups.google.com/group/micro...6e8422133f2bd3 link may wrap Good luck! Susan "Youngpioneer" wrote in message ... First of all, thanks very much for your reply, The solution was great, but still I have only one question: Could I extract it as a PDF format? |
Thread Tools | |
Display Modes | |
|
|