PDA

View Full Version : Solved: Label Printing



GaryB
03-02-2005, 04:05 PM
Hi everyone,


Here's a good one that was posed to me. We are printing to a thermal laser label printer that prints one off labels. I developed a form and report to print to it that allows me to print multiple labels ie... 1 of 4, 2 of 4, 3 of 4 etc.. but I seem to be limited to how many I can create this way by the size limitation of the report sheet when in design mode. What I really would like to create is a way to bring up a form that has one label on it enter the information and tell it to print 20 labels, lets say, and have it automatically number itself 1 of 20, 2 of 20 etc.... Does anyone have any ideas of how I might go about this. Any help would be greatly appreciated.

thanks

GaryB

downwitch
03-03-2005, 06:59 PM
Right: one label in the report, not multiples.

Then you just increment a variable in the report, and send it to a control every time you format or print the detail. Or use an unbound control, set its control source to =1, and set its running sum property to Yes.

Clear example here (http://www.blueclaw-db.com/access_report_line_counter.htm).

MS example here (http://support.microsoft.com/default.aspx?scid=kb;en-us;98790).

GaryB
03-04-2005, 10:56 AM
Hi Downwitch,

I think I get the idea of what this does, but what I don't see is how to control it. What I mean is if I set this code on the report how do I control it from the Form? Or, do I set it in both places?

Thanks



Gary

I also forgot to mention that I am working in Access 2000

Gary

downwitch
03-05-2005, 08:33 AM
What kind of control are you after? I thought you just wanted to count 1 of 10, 2 of 10, etc.? That you can set automatically, just on the report, as the example link shows.

Please let us know what you're looking for.

GaryB
03-07-2005, 08:16 AM
No not exactly like that. I am printing a shipping label to a printer that prints one label at a time and outputs them connected to one another perf'd end to end. What I am trying to do is control it from the form so I can add the information I need desc. etc... and then tell it to print, let's say 20 labels. As they print, on the single label, the first one would say 1 of 20 then the next label printed would say 2 of 20 and so on.

G

downwitch
03-09-2005, 06:11 PM
Okay... Well, that sounds like what I'm describing, so I'm confused. If you put a control on the report called txtCountMe, set its Control Source to =1, set its Visible property to No, set its Running Sum property to Yes, and then create a second control called txtShowMyCount, set its Control Source to
=[txtCountMe] & " of " & [Forms]![FrmYou'rePrintingFrom]![CtlWithNumberOfLabelsToPrint]where you replace the form and control names with your own, does this do it?

Or is it that you need to control the number of labels to print and you don't know how to do that? See MS's setup for that here (http://support.microsoft.com/default.aspx?scid=kb;en-us;95806).

GaryB
03-10-2005, 07:23 AM
I am not describing what I am trying to do very well. I want to print multiple copies of one record and have each printed page numbered 1, 2, 3, 4, etc.... I am totally clueless on this.

Gary

Anne Troy
03-10-2005, 07:34 AM
We did a project like this once in Excel. So, you might have to ship 20 boxes or 50 boxes, and you need to label each box 1 of 20, 2 of 20, and so on, but that's really the only thing that changes from one label to the next.

We did a thing where you entered the address, the total number of labels to create, and which number to start printing at--in case the printing was disrupted somehow. I don't guess the code/file would be helpful here... :) But maybe I've explained it a little better? I remember when we did it that the person had a hard time explaining what they wanted.

GaryB
03-10-2005, 09:18 AM
yeah,

that pretty much says it. I have to print a label to a thermal label printer and need it to print a single record multiple times and number each lable 1 of 10, 2 of 10 etc... addressing is not an issue, it's stuff like box count, customer name, po# , desc. which I have all of that figured out. I already have forms and reports that can print to it, but, what is being requested is the ability to just tell it to print a a certain amount of labels for one a single record and have it print out the multiple copies and number each label. this shouldn't be this hard, but, I can't see the forest for the trees.

somehow I need to tie in the 1of5, 2of5 etc... with the number of pages I tell the report to print. I just can't seem to come up with anything that works.

Gary

GaryB
03-10-2005, 11:25 AM
Okay... Well, that sounds like what I'm describing, so I'm confused. If you put a control on the report called txtCountMe, set its Control Source to =1, set its Visible property to No, set its Running Sum property to Yes, and then create a second control called txtShowMyCount, set its Control Source to
=[txtCountMe] & " of " & [Forms]![FrmYou'rePrintingFrom]![CtlWithNumberOfLabelsToPrint]where you replace the form and control names with your own, does this do it?

Or is it that you need to control the number of labels to print and you don't know how to do that? See MS's setup for that here (http://support.microsoft.com/default.aspx?scid=kb;en-us;95806).
I tried this code and it showed the page of page number in the report, but, it stayed the same number on every page. What I am trying to do is print multiple copies of the same report and have the page count change on each printed sheet. Some how I need to have the page count on the report tie in to the number of pages requested to print in the print dialogue box and then have each printed page change count. Boy now I am really lost.

Gary

downwitch
03-10-2005, 03:46 PM
Aha. I thought you were trying to print a labels report, which involves multiple records on the same page. If you've just set your report page size to the label size, there is nothing simpler in the world:

1. Forget everything I told thee before. Unlose thyself.
2. Add a control called txtPgCount to the detail.
3. Set its control source to
=[Page] & " of " & [Pages]The end.

We won't bother trying to fix the other "code" if this works, though I'm pretty sure it was okay. Not worth the confusion, especially if this solves the problem.

GaryB
03-10-2005, 03:59 PM
Tried it - still printing the same 1 of 2 on both pages. Now, let me go into a little more depth. From the form I have a button that is just a basic preview report. From the report preview window is where I am setting the number of copies I want printed. Could this be the problem?

Gary

downwitch
03-10-2005, 04:18 PM
Aha. Forget that last post, I had only read your most recent reply.

There is great confusion here.

First off, I thought you were trying to print a labels report, which involves multiple records on the same page. I hope you can understand that difference--printing to a sheet of mailing labels, as opposed to a spool or some such. Two very different sizes of paper, two different sets of rules.

Second, you keep saying pages, which is fine in English, but to Windows--this is really a Windows complication, not an Access one--you mean copies. You're not setting the number of pages in the dialog, you're setting the number of copies. You may think you're telling Access to print out 20 "pages" of labels, but you're wrong--you're telling Windows to print out 20 copies of the same "page".

This is what makes this tricky--between Windows and Access there is a pages-vs-copies gap, and you're falling into it. Sorry if you're completely lost, but that's the reason. It may seem like a simple problem, but it isn't, and dealing with it in Access--only a pretend-user-friendly program after all--makes it even trickier. The link wouldn't have printed the numbering; it only would have allowed you to skip the "copies" setting in the Windows dialog box.

Anyway, sorry for the confusion, I'm sure it's frustrating. Please download the attached db, which (apart from good ol' page setup, which will require your specific printer I'm afraid) contains a fully working version of what you're after, adapted from the MS example, all numbering working on this computer anyway. You should be able to copy the various procedure lines (Report - On Open, Report Header - On Format, and Detail - On Print) in my example report into your own, just changing the report name to match.

Hope this solves it for you

EDIT: Our posts cross in space... everyone on the same page now, I think. Or would that be the same copy?

Anne Troy
03-10-2005, 04:55 PM
LOL! Excellent, Down!! Excellent...
Here it is in Excel...just in case! www.vbaexpress.com/EE/labelmaker2.zip (http://www.vbaexpress.com/EE/labelmaker2.zip)

GaryB
03-11-2005, 07:57 AM
DOWNWITCH,

YOU ARE INDEED AWESOME IN EVERY DEGREE. THIS CODE WORKED PERFECTLY. WITH A SLIGHT MODIFICATION TO FIT INTO MY EXISTING DATABASE IT IS DOING EXACTLY WHAT I NEEDED IT TO DO. THANK YOU SO SO MUCH

GARYB

Anne Troy
03-11-2005, 03:18 PM
...aha

A time when caps used for yelling is rather appropriate! :)