Basic Coding Help

G

Guest

Hey guys,
Not sure if I'm in the right forum or not, if not could someone point me
in the right place?
Basically, I have a list of 16000 addresses that I need to divide into
blocks of 10.
I haven't been able to get a query to parse through 10 records and then dump
them into a report, pull the next 10 records, etc.
Any Ideas?
Thanks
Will
 
G

Guest

You can add another field to your table and use a couple of queries and a
macro but it sounds like you are printing labels manually. If that is the
case just put it on manual feed.

Use a select query to check PrintDone field and set to print only TOP 10.
Second action in the macro is to flag the TOP 10 records of the PrintDone
field.

Repeat the macro again and again. I think a macro can only call itself
about 12 times before it crashes.
 
G

Guest

Will:

You can use integer division in a subquery to group a set of rows into
subsets of a given number of rows. If you include the subquery in the
query's WHERE clause you can use a parameter to select the group to be
returned. Using the sample Northwind database try the following query:

SELECT *
FROM Customers AS C1
WHERE
(SELECT COUNT(*)\10 + 1
FROM Customers AS C2
WHERE C2.CustomerID < C1.CustomerID)
= [Enter Group Number:];

Entering 1 at the parameter prompt returns the first 10 rows, 2 the second
10 and so on. Printing reports based in this query would prompt for the
group number before each report is printed. You could easily semi-automate
this with some code which pops up a 'Print Next Report?' message box between
each report and adds 1 to the group number when OK is clicked in the message
box.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top