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

Print Variable Line Count Labels!

Status
Not open for further replies.

TheAceMan1

Programmer
Sep 23, 2003
11,174
US
Howdy All! . . .

Have labels to print which have a variable record count in the detail section( presently 1 to 6). That is each label can have 1 to six lines of data.

How do I [blue]tell the report to starting printing at the next label location when the current label record group is finished?[/blue]


Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
It isn't clear to me what you are asking. Do you have a field in your report's record source that determines the number of copies of the record that you want to print?

What do you mean by "label record group"? What do you mean by "1 to six lines of data"?

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Howdy dhookom . . .

Yes your correct! In the report there's a [blue]grouping level on Names[/blue] (header with Name field and empty footer). The detail section has a single field called [blue]MenuItem[/blue]. [blue]MenuItem[/blue] is the field with variable record count . . . per name.

There's a method to start printing on a specific label other than the 1st. I believe I need the equivalent of this as far as jumping/skipping to the next label is concerned.

I'm currently experimenting with the following:
[ol][li]In the Name grouping level, get the recordcount for the current name and set a global variable.[/li]
[li]The detail section counts the number of lines printed, and when this count matches the global, the group name footer height is adjusted to compensate for total label height.[/li][/ol]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
If you want to print several copies of a single record based on a field stored in the record:
- create a table of numbers [tblNums] with a single numeric field [Num] and all values from 1 to some big number
- add this table to the record source of your report and don't add an joins to the table.
- set the filter under your [Num] field to
<=[MenuItem]
Is this what you need?

If you want to start printing at a particular label on a sheet of labels, FredG posts the solution to this on a regular basis. I google and found this thread
Duane MS Access MVP
Now help me support United Cerebral Palsy
 
dhookom . . .

Thanks for the response. This report involves the printing of meal cards (a week in advance), where the user selects from items provided for breakfast, lunch, and dinner, per day. A one time printing for the entire week is done.

In any event problem solved. For reference, here's the code used to accomplish the task:
Code:
[blue]Option Compare Database
Option Explicit

Private DetCnt As Integer [green]'hold number of records[/green]

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
   [GroupFooter1].Height = 0 [green]'reset footer height[/green]
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
   DetCnt = DetCnt + 1 [green]'count number of records printed[/green]
End Sub

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
   Dim maxheight As Integer, linHeight As Integer
   
   maxheight = 2140  [green]'1.48 inches[/green]
   linHeight = Me!Item.Height [green]'height of a line[/green]
   [GroupFooter1].Height = maxheight - (DetCnt * linHeight) [green]'Compensation[/green]
   DetCnt = 0 '[green]reset DetCnt[/green]

End Sub[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top