PC Review


Reply
Thread Tools Rate Thread

Best way to create dynamic shipping labels?

 
 
FT1973MDB
Guest
Posts: n/a
 
      17th Jul 2008
I created a product / order database that they recently wanted to add a
shipping module to.

If we are shipping CDs, and you can fit 30 CDs in a box, I want the thing to
create a shipping label for each set of 30, and one label for any remaining
CDs in the last box.

So something like... (I will speak in Semi-SQL)
WHILE [ShipQty] is greater than 30 and more than 0
DO CMD Create shipping label;
[ShipQty]=([ShipQty]-30);
LOOP
DO CMD Create last shipping label
END

....Except I'm not quite sure what to say or where to put it, but I'm kind of
sure I need to loop... I was at first thinking writing the loop in a query
and then output via a "report" designed to fit on a label?? It's the end of
the week and my brain hurts - any help is appreciated.

 
Reply With Quote
 
 
 
 
Jim Burke in Novi
Guest
Posts: n/a
 
      17th Jul 2008
I'm assuming that you have a field somewhere that has the quantity value. I'm
not sure how your tables are defined, but once you have that quantity, then
you could calculate the # of labels like so:

dim labelCount as integer

labelCount = quantity / 30
if quantity Mod 30 > 0 then ' gives remainder of quantity/30
labelCount = labelCount + 1
end if

that gives you the # of labels you need. I thought there was a way of
specifying the # of copies when printing a report via VBA code, but can't
remember how to do it. This would work though:

if labelCount > 0 then
for i = 1 to labelCount
docmd.openreport "reportName"
next i
end if

I'm sure there's a simple way to just print it once and specify the# of
copies.


"FT1973MDB" wrote:

> I created a product / order database that they recently wanted to add a
> shipping module to.
>
> If we are shipping CDs, and you can fit 30 CDs in a box, I want the thing to
> create a shipping label for each set of 30, and one label for any remaining
> CDs in the last box.
>
> So something like... (I will speak in Semi-SQL)
> WHILE [ShipQty] is greater than 30 and more than 0
> DO CMD Create shipping label;
> [ShipQty]=([ShipQty]-30);
> LOOP
> DO CMD Create last shipping label
> END
>
> ...Except I'm not quite sure what to say or where to put it, but I'm kind of
> sure I need to loop... I was at first thinking writing the loop in a query
> and then output via a "report" designed to fit on a label?? It's the end of
> the week and my brain hurts - any help is appreciated.
>

 
Reply With Quote
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      17th Jul 2008
On Jul 17, 3:43*pm, Jim Burke in Novi
<JimBurkeinN...@discussions.microsoft.com> wrote:
> I'm assuming that you have a field somewhere that has the quantity value.I'm
> not sure how your tables are defined, but once you have that quantity, then
> you could calculate the # of labels like so:
>
> dim labelCount as integer
>
> labelCount = quantity / 30
> if quantity Mod 30 > 0 then * * ' gives remainder of quantity/30
> * *labelCount = labelCount + 1
> end if
>
> that gives you the # of labels you need. I thought there was a way of
> specifying the # of copies when printing a report via VBA code, but can't
> remember how to do it. This would work though:
>
> if labelCount > 0 then
> * *for i = 1 to labelCount
> * * * docmd.openreport "reportName"
> * *next i
> end if
>


> I'm sure there's a simple way to just print it once and specify the# of
> copies.


Public Sub PrintReport(ByVal strReportName As String, ByVal intCopies
As Integer)
DoCmd.OpenReport strReportName, acViewPreview
DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, True
End Sub

The way I figured to do this would be to do the full sheets first.
Integer divide the number of labels by the number of labels on the
label page (30 for the 5160 style labels). Then print that number of
copies...

intReportCopies = intLabelsToPrint\intLabelsPerPage

Then join the query that has the single record to a table of numbers
from 1 to say, 29.

set the criteria to be less than or equal to the number of remaining
copies (intLabelsToPrint Mod intLabelsPerPage).

Then print that report.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail merge shipping labels =?Utf-8?B?R0ZF?= Microsoft Word Document Management 1 7th Jun 2007 05:50 AM
Shipping Labels from Outlook? Talal Itani Microsoft Outlook 0 24th Apr 2007 01:05 AM
Shipping Labels klp via AccessMonster.com Microsoft Access Queries 12 25th Jan 2007 11:47 AM
shipping labels slidellinternational@gmail.com Microsoft Word Document Management 2 18th Sep 2006 04:12 PM
Shipping labels Todd Microsoft Access Reports 1 8th Sep 2003 11:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:27 AM.