Solved

programatically print multiple pallet labels that are numbered sequentially

Posted on 2007-03-27
7
526 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

830 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