473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Breaking up a report or looping through?

Hi, I hope you may be able to help a coding novice.

I have a fairly simple db which extracts data to a report via a query,
my problem is the report is three pages per record set and a total of
3000 sets. When I send the report to our printer/copier for stapling,
Access and the printer think it's one job and treats the report as one
document instead of 3000 sets of three pages, and tries to staple the
whole job together. I think I need to loop through the query data and
send it through the report one at a time. I also believe I need to have
an autonumber field in the query for reference, which I am not sure how
to create.

I need to keep it within Access because the report contains graphics
which get lost when exporting. Page breaks don't work as the report is
still one big document.

My experience with coding stops with creating a new module, so any help
would be gratefully received.

Thanks, Slotz

Nov 13 '05 #1
1 3123
to********@hotmail.co.uk wrote:
Hi, I hope you may be able to help a coding novice.

I have a fairly simple db which extracts data to a report via a query,
my problem is the report is three pages per record set and a total of
3000 sets. When I send the report to our printer/copier for stapling,
Access and the printer think it's one job and treats the report as one
document instead of 3000 sets of three pages, and tries to staple the
whole job together. I think I need to loop through the query data and
send it through the report one at a time. I also believe I need to have
an autonumber field in the query for reference, which I am not sure how
to create.

I need to keep it within Access because the report contains graphics
which get lost when exporting. Page breaks don't work as the report is
still one big document.

My experience with coding stops with creating a new module, so any help
would be gratefully received.

Thanks, Slotz


Let's say you have a table called Customers and you want the report to
print the report for each customer. You could do something like this...
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intCurrent As Integer

'sort the table by customer name
strSQL = "Select CustomerID, CustomerName From Customers " & _
"Order By CustomerName"
Set rst = Currentdb.OpenRecordset(strSQL,dbopensnapshot)
If rst.RecordCount > 0 then
Docmd.Hourglass = True
'move last to get the record count
rst.MoveLast
rst.MoveFirst
Do while not rst.EOF
intCurrent = intCurrent + 1
Me.RecMsg = intCurrent & "/" & rst.RecordCount
Me.CustMsg = rst!CustomerName
Docmd.OpenReport "TheReportName",,,"CustomerID = " & _
rst!CustomerID
rst.MoveNext
Loop
Docmd.Hourglass = False
Endif
rst.Close
set rst = Nothing
msgbox "Done"

I put in an hourglass but you could have something on the form that
informs the user how many records you've printed and what customer you
are printing. So I put in the Rec/Cust msg references.

I don't know how well this will work...the reason being is that you are
creating 3,000 separate reports; 1 report for each customer. That's a
lot of jobs to stuff into a print queue. I don't know if you'd need to
put in a pause function to print/pause for each customer. I guess
testing is the best way to do it.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: arthur-e | last post by:
I can filter a query for a report on a field of a subform BUT now.... I'd like to be able to select more than one item in a multi-list box to select all the records. ALSO to use two fields (or...
2
by: Bob Quintal | last post by:
I have a report that prints a single record. Normally it's enter one record, then print it. This works great. New requirement: Each record needs to be printed to an individual ..pdf file from...
1
by: Justin Koivisto | last post by:
I am trying to create a report that displays a name of an advertising source and count of the number of times it was hit between certain date ranges. The data is split between two different...
1
by: bruce | last post by:
Hello, I have a small form that pops up when a user moves off the current record of a rather sizeable data entry form. The purpose of this form is to list warnings about various fields on the...
0
by: Madhu Subramanya | last post by:
I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am...
1
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs...
6
by: Richard Hollenbeck | last post by:
Thanks to everybody who has helped me to get this thing finally working (somewhat). I got the field names to properly display in the PageHeaderSection, so I won't post the code from that. Now I'm...
35
by: JessicaZ | last post by:
Hi everyone! I'm new here and have a question regarding Leban's report to pdf tool. I am working on a database where we are using this code to send a report out to pdf(duh) BUT what I need to do is...
7
by: DThreadgill | last post by:
Don't know if this can be done or not but I'm sure the gurus here will let me know ;) Got a .csv file that is being imported into a table using specs. The table consists of the following: Issue...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.