Solved

programatically print multiple pallet labels that are numbered sequentially

Posted on 2007-03-27
7
490 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

10 Experts available now in Live!

Get 1:1 Help Now