Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Multple Labels with Same Value In Reports

Status
Not open for further replies.

NewYorkFashionToGo

Programmer
Oct 20, 2006
44
US
I have a table for purchases that I have made for new stock. It access creates the part number for me and I am trying to create multiple labels for the product based on the quantity field of that product. Does anyone know how to go about doing this. Product ID= XXX-My product-123 quantity Purchased 20 I want 20 Labels to print out.
 
Since fox treats each label like a detail line in a report,

You could use your quanity field to append the number of duplicate records into another table and run the label against that table.

Word has a handy tickbox in its label creation that you can check and make a full page of the same label at once.

If you were going to automate word to do this i think you would start by exploring the

Application.MailingLabel.CreateNewDocument

with its paramaters, which are difficult to figure out sometimes.
wjwjr
 
Hi NewYorkFashionToGo,

A good approach would be to create a temporary table (or cursor) to use as the source for the report. Insert the required number of records into that table for each stock item.

Off the top of my head, your code would go something like this:

Code:
CREATE CURSOR Temp ;
  (ProductID C(20) )
SELECT Stock
SCAN
  FOR lnI = 1 TO Stock.Quantity
    INSERT INTO Temp ProductID VALUES Stock.ProductID
  ENDFOR
ENDSCAN
SELECT Temp
REPORT FORM MyReport

I haven't tried to test that, but it should give you the general idea.

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top