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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label Report 1

Status
Not open for further replies.

Griff389

Technical User
Jun 27, 2003
82
0
0
GB
I need to create a report that I can use to print some address labels onto an A4 page of labels based on data in a table.

The Report itself isn't the problem as that's not too dificult to create.

The problem I can forsee, is when one print run is finished, it may only have used half the labels on the page. Would it be possible for the report to ask, when it's opened, which number label to start printing on so I don't end up with lots of half used sheets of labels? Anyone know how to do this, or maybe another solution?

Rgds

Carl
 
It sounds like you are printing more than 1 set of reports at a time and want to do one right after the other. If that's the case, there is a recent thread in this forum that tells how to run several sets of reports from 1 report by creating a sub-report.

If that's not the case, what I did with my label product probably isn't the best solution, but it certainly works: I export the table to excel and do a word mail-merge on it. If you can't find anything better that would get you by. I put fake entries into my excel doc to fill in the blank labels...

Hope you find a better solution 'cause maybe I could use it :>)
 
I see where you're coming from with the excel and word solution but was really wanting to keep it to access if possible.

I've only got one label report, but when putting the labels into the printer, if there a few already used on the sheet i'd like to be able to choose which label position to start from. The posistion being the first label and the sheet and not have to use a new sheet of labels .

Maybe a field and a filter or query may be the answer?
 
The Access 2000 Developer's Handbook by Gilbert, Litwin, and Getz (Sybex) (hope I remembered the authors right) contains code to do this. Later editions probably include it, too.

I also have a class I wrote that can be easily plugged into any report. The idea came from ADH, but the code is all mine. My intent is to create a FAQ from it some day, but I don't have the time at present.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
If you just wish to skip missing labels, this will do that.

First make sure your label report is properly printing a full sheet of labels.

Then add a Report Header to your label report.
Add 2 text boxes to the Header.
1) Name one SkipControl
Leave it's control source unbound

2) Name the other SkipCounter
Set its control Source to =[Skip How Many?]

Now code the Report Header Format event as below:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub
==========

Next code the Detail OnPrint event:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If PrintCount <= [SkipCounter] And [SkipControl] = &quot;Skip&quot; Then
Me.NextRecord = False
Me.PrintSection = False
Else
[SkipControl] = &quot;No&quot;
Me.PrintSection = True
Me.NextRecord = True
End If

End Sub
=====

When you are ready to run the label report, it will ask how many to skip.
Then it will run the report.


Duane
MS Access MVP
 
Cheers Duane,

I added the code and fields as you described and it's worked a treat. Thanks for that. [2thumbsup]

Griff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top