Consulting

Results 1 to 16 of 16

Thread: Solved: Label Printing

  1. #1
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location

    Solved: Label Printing

    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

  2. #2
    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.

    MS example here.

  3. #3
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  4. #4
    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.

  5. #5
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  6. #6
    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.

  7. #7
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  8. #8
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    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.
    ~Anne Troy

  9. #9
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  10. #10
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    Quote Originally Posted by downwitch
    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.
    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

  11. #11
    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.
    Last edited by Ken Puls; 03-10-2005 at 05:00 PM. Reason: Post restored by kpuls to retain thread flow

  12. #12
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  13. #13
    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?

  14. #14
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    LOL! Excellent, Down!! Excellent...
    Here it is in Excel...just in case! www.vbaexpress.com/EE/labelmaker2.zip
    ~Anne Troy

  15. #15
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    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

  16. #16
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    ...aha

    A time when caps used for yelling is rather appropriate!
    ~Anne Troy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •