A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

New file for each report printed



 
 
Thread Tools Display Modes
  #1  
Old July 19th, 2006, 10:16 AM posted to microsoft.public.access.reports
Youngpioneer
external usenet poster
 
Posts: 11
Default 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  
Old July 19th, 2006, 12:45 PM posted to microsoft.public.access.reports
SusanV
external usenet poster
 
Posts: 399
Default 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  
Old July 19th, 2006, 02:18 PM posted to microsoft.public.access.reports
Youngpioneer
external usenet poster
 
Posts: 11
Default 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  
Old July 19th, 2006, 02:40 PM posted to microsoft.public.access.reports
SusanV
external usenet poster
 
Posts: 399
Default 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  
Old July 22nd, 2006, 06:16 AM posted to microsoft.public.access.reports
Youngpioneer
external usenet poster
 
Posts: 11
Default 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  
Old August 14th, 2006, 10:02 AM posted to microsoft.public.access.reports
Youngpioneer
external usenet poster
 
Posts: 11
Default 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  
Old April 8th, 2010, 08:42 PM posted to microsoft.public.access.reports
GrimesRL
external usenet poster
 
Posts: 2
Default 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  
Old April 9th, 2010, 12:53 PM posted to microsoft.public.access.reports
Lance McGonigal[_2_]
external usenet poster
 
Posts: 3
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.