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

PRINT MULTIPLE LABELS FROM 1 ENTRY 1

Status
Not open for further replies.

billquga

Technical User
Aug 23, 2001
19
US
Hello all. I am trying to create a database that allows me to enter address information in either the form screen, or the report screen, then print the selected amount of labels onto the pages. currently i have a databse that has 1 field. then i have a report where the field is on the label. then i added 4 text boxes onto the design of the label which prompts you to enter the rest of the information. i would like to be able to choose how many labels show up on the pages.

EX.i have a page of labels with 2 accross and 6 down.
x x
x x
x x
When i run the report and then print it, the address only prints where the first label is. What if i need 3 of that same label? If i repeat the process, wont the next label also print on the first label. Any help would be much appreciated.
 
You can use this code in the print event of the detail section of your label report to print multiple copies. I have a form where the user specifies teh number of copies in a textbox, then when they run the report it prints that many copies of each label. Alternatively, if you had varying requires (IE: 6 of this label, 3 of that, 10 of those) you can put a quantity field in your table and have the code inspect the quantity field. I've used this approach as well.
[tt]
If [Forms]![MyFormName]![txtCopies] = 0 Or IsNull([Forms]![MyFormName]![txtCopies]) Then
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
Else
If PrintCount < [Forms]![MyFormName]![txtCopies] Then
Me.NextRecord = False
End If
End If
[/tt]

HTH Joe Miller
joe.miller@flotech.net
 
Thank you very much for your quick responce. I can create the database, and the report and the form, but i cant get his code to run.I added a field to the table called [txtCopies] and added a text box in the form with the same name. I copied the code from the top down to the letters HTH and copied it into the print event at the detail section. I can add data in the form or table, but when i open the report, i get the following error message:
THE EXPRESSION ON OPEN YOU ENTERED AS THE EVENT PROPERTY SETTING PRODUCED THE FOLLOWING ERROR: INVALID OUTSIDE PROCEDURE.
*THE EXPRESSION MAY NOT RESULT IN THE NAME OF A MACRO, THE NAME OF A USER DEFINED FUNCTION, OR [EVENT PROCEDURE].
*THERE MAY HAVE BEEN AN ERROR EVALUATING THE FUNCTION, EVENT OR MACRO.
I'm not sure what i did wrong. I'm not that familiar using this kind of code, so i just must not understand. Any ideas would be helpful. :-I
 
It sounds like you put the code in the wrong place, open the report in design view and remove the code above from where you put it. Click the detail section of your report (where the white grid is), go to properties, in the event that says &quot;On Print&quot; click the ... button to the right, paste the code above.

Joe Miller
joe.miller@flotech.net
 
Thank you very much JOEMILLER. Sometimes you feel like your the smartest man alive when you get something to work like this. I got it to work, thanks to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top