Normal Topic My label printing routine - is there a better way? (Read 404 times)
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
My label printing routine - is there a better way?
Aug 17th, 2012 at 9:30pm
Print Post Print Post  
I keep having a nagging, intermittent problem with Sesame crashing while we're receiving in product and printing inventory labels for those items.

So, as we're receiving in line items on the POLines subform, the focus goes to QtyRecd field.  We enter the quantity incoming, then tab which takes the focus to the PrintInventoryLabels command button.  We click on that button, and it executes the following code to print the labels to a Brother QL-580 network label printer:

         vLoop = 1
         NewDocument(1)
              While vLoop <= vQtyRecd0
               {
                 NewPage(840, 240)
                   PrintPageOrientation(2)
                   PrintString(vItemNum, 6, 6, 0, " ARIAL", 11, 0)
                PrintString(vItemDesc, 6, @PageExtentY(), 200, " ARIAL", 8, 0)
                PrintString("---------------", 160, 48, 0, " ARIAL", 9, 0)
                   PrintString("WordCom 918-582-8844", 15, 54, 0, " ARIAL", 9, 0)
                PrintString("PO#" + " " + vPONum, 160, 54, 0, " ARIAL", 9, 0)
                   PrintString("www.wordcom.com" + "   [ " + vAvgSalesPerWeek + " ]", 15, 63, 0, " Arial", 8, 0)
              FinishPage()
            //Loiter(200)
                 vLoop = vLoop + 1
               }
            FinishDocument()

       Loiter(500)

       //RestoreDefaultPrinter()
       ThrowFocus(NextRecord)


My belief is that what causes the crash (which I have been unable to ascertain a pattern to it) is if we go through the receive routine too quickly, and the print buffer gets bogged down (in other words, if we receive 30 each of ItemA and print labels, then immediately receive in 20 each of ItemB and click PrintLabelsButton - while Sesame is still printing the labels from ItemA (due to the relatively slower speed of the label printer) - then sometimes the program will crash, and I'm wondering if the print buffer is getting overwhelmed, or if Sesame is running up on itself ?

Is there a more efficient/effective way for me to structure this printing code piece?
  

Larry
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: My label printing routine - is there a better way?
Reply #1 - Aug 20th, 2012 at 12:27pm
Print Post Print Post  
Since you're using a Brother printer you may want to check out their free bPAC development software. It's kind of a front end for their printers, and it might give you more control over the setup of the labels, and it might solve the bogging down of the printer.

Here's a link: http://www.brother.com/product/dev/label/bpac/index.htm

I use a QL-500 printer, and use the bPAC software. I don't know if this would work for you, but it worked for me.
  
Back to top
IP Logged