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  

Print the same record twice



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2004, 09:42 PM
Bill Phillips
external usenet poster
 
Posts: n/a
Default Print the same record twice

I need to print labels for products I ship out. A customer
may order 2 cases of product A and 3 cases of product B.
Subsequently I need 2 & 3 labels respectively. I would
like to query the order file and create a column called
LabelQty that passes a parameter to the report telling it
how many of each label to print.

I'm fairly sure I can do this with an On Format event in
the Detail section, but I just can't figure out the code.
Any help or references will be greatly appreciated.
  #2  
Old May 19th, 2004, 10:47 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Print the same record twice

Bill Phillips wrote:

I need to print labels for products I ship out. A customer
may order 2 cases of product A and 3 cases of product B.
Subsequently I need 2 & 3 labels respectively. I would
like to query the order file and create a column called
LabelQty that passes a parameter to the report telling it
how many of each label to print.

I'm fairly sure I can do this with an On Format event in
the Detail section, but I just can't figure out the code.



I can think of two ways to approach this issue. The one you
asked about is to keep a counter variable in the detail
section's Format event procedure and use that to control the
report's MoveNext property. I don't feel very comfortable
using an event procedure counter.

Another way is to create a table named NumCopies with one
field named Qty. Populate the records in the table with
consecutive numbers from 1 to more than you ever need for
duplicate labels. Then add that table to the report's
record source query without any join line between the two
tables and a criteria that limits the Qty field to the
number of cases ordered. E.g.

SELECT Orders.*, NumCopies.Qty
FROM Orders, NumCopies
WHERE Orders.OrderDate Between [Start] And [End]
AND NumCopies.Qty = Orders.NumCases

This will provide the label report with the appropriate
records so that report does not have to be concerned with
duplicating anything.
--
Marsh
MVP [MS Access]
 




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 08:19 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.