Solved

programatically print multiple pallet labels that are numbered sequentially

Posted on 2007-03-27
7
513 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search for text in a .txt file 14 46
Create macro from runcode 30 26
Why get error when delete all records on a sub-form 2 17
Display <> "Yes" records 10 10
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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.

831 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