Solved

programatically print multiple pallet labels that are numbered sequentially

Posted on 2007-03-27
7
503 Views
Last Modified: 2008-02-07
I would like to programatically print multiple pallet labels with the same item information that are numbered sequentially. The amount of labels will be based on a calculation in the form. Example… if there are 100000 items and each pallet contains 10000 then the number of pallets is 10 so there would be 10 labels printed with the first having “1” at the bottom and the last having "10" at the bottom. As usual it's urgent. Thanks, Jim
0
Comment
Question by:jbrown0828
  • 3
  • 3
7 Comments
 
LVL 2

Expert Comment

by:PapaLorax
ID: 18801018
How are you printing the labels? Is there code behind a button? You should be able to run a calculation then run a loop where an unbound field prints Page X and Y. If you let me know what code fires the printing I can give you an example.
0
 
LVL 57
ID: 18801047

  Are you doing UCC128 labeling?  Simple setup is to use code in the reports detail band OnFormat event to increment a counter and push the value into the needed controls.

  More sophisticated would be to setup tables with one record per label.  Code would be written to populate the table(s).  The label then would just be a "normal" report that would print off that.

JimD
0
 

Author Comment

by:jbrown0828
ID: 18801228
To answer both papalorax and jimd's questions...papalorax...the code behind the print button is currently just onclick Do.Cmd.PrintOut. The unbound field is just a calculation of 2 fields quantity/quantity_per_pallet . JimD...There will be some barcoding later but for now all I need is the sequential numbering and I have considered doing a make table query to populate a table with this data but was hoping there would be a simpler "coded" way from the original form's printout command. Thanks to both of you for your quick response
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 57
ID: 18801360
<<JimD...There will be some barcoding later but for now all I need is the sequential numbering and I have considered doing a make table query to populate a table with this data but was hoping there would be a simpler "coded" way from the original form's printout command. >>

  Might want to go with the make table then.  Even if you just empty the table between label runs.  That will set you up for the future.

  From the output command itself you can't do anything, but in the report, you can do this:

1. In the declarations section, dim a counter:

   Dim lngLabelCount as long
   
2. In the OnFormat event of the Detail band do:

  If FormatCount = 1 then
     ' Add one to the label count
     lngLabelCount = lngLabelCount + 1
    If lngLabelCount >   <max labels> then
        DoCmd.Close
    Else
       Me![<my label count control>] = lngLabelCount
       Me.PrintSection =  True
       Me.MoveLayout = True
       Me.NextRecord = False
    End If
  End If

  <max labels> is a value you need to pass in either in a memory variable or as part of openargs (A2003 and up).

  The above assumes one record is available, which it will repeat over and over until the label count is reached.

JimD
0
 

Author Comment

by:jbrown0828
ID: 18802770
Thanks Jim for the "labelcount" idea but your original conclusion about developing a temporary table seems to be the best way to deal with this. The final product will have the item number and its respective pallet number concatenated into a barcode, which as far as I know could not be accomplished in a report label without that data coming from a table. So I guess my next task is to figure out how to create a make table query that will duplicate a record the appropriate number of times and get around the lack of "autonumbering"
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 18803375
<<So I guess my next task is to figure out how to create a make table query that will duplicate a record the appropriate number of times and get around the lack of "autonumbering">>

  I would write it in code.  A simple loop with an single INSERT into the table each time.

JimD.
0
 

Author Comment

by:jbrown0828
ID: 18812126
Thanks JimD, I wrote it in code and that will do the trick. Thanks for the advice about not being able to accomplish this from the output command. I guess I was too stubborn about simplifying when I should have just knuckled down.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now