473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Labels - Printing varying numbers

MJ
Is it possible to print varying numbers of labels from Access?

Mar 10 '06 #1
6 2192
On 9 Mar 2006 19:48:18 -0800, "MJ" <je*******@cox.net> wrote:

Yes.
For i = 0 to Rnd(1000)
Docmd.OpenReport "myLabelReport"
Next i

Or clarify your question.

-Tom.
Is it possible to print varying numbers of labels from Access?


Mar 10 '06 #2
MJ
I am trying to find out if it is possible to make labels to put on
products as they arrive for inventory purposes--that are listed in a
database. Can a table or query allow you to print 10 labels for one
item, 5 of another, etc.--instead of 1 label each or a whole sheet of
one.

Mar 10 '06 #3
On 9 Mar 2006 20:07:55 -0800, "MJ" <je*******@cox.net> wrote:

I'm assuming a sheet has several labels.
One option is to print a sheet for each product and stick it in a
binder. User locates that page in the binder, takes off as many labels
as needed, and prints new sheet if ran out.

Alternatively you can create a query that returns 10 rows of product A
and 5 rows of product B, and use that query for your label report.
This seems to be what you want to do. To accomplish the "several
duplicate rows" part, I would use a recordset on a "temporary" table,
and use rs.AddNew to create as many rows as I needed:
For i = 1 to Me.MyQuantityField
rs.AddNew
rs.ProductID = Me.cboProducts
'etc.
rs.Update
Next i

-Tom.
I am trying to find out if it is possible to make labels to put on
products as they arrive for inventory purposes--that are listed in a
database. Can a table or query allow you to print 10 labels for one
item, 5 of another, etc.--instead of 1 label each or a whole sheet of
one.


Mar 10 '06 #4
MJ
Thanks!

Mar 10 '06 #5
I don't recall where I got this function, but it alllows you to skip
labels (if your sheet is missing some already) and also enter how many
you would like.

Create the following Module:
************************************************** ************************
Option Compare Database
Option Explicit

Dim intLabelBlanks As Integer
Dim intLabelCopies As Integer
Dim intBlankCount As Integer
Dim intCopyCount As Integer

'================================================= =========
' The following function will cause an inputbox to
' display when the report is run that prompts the user
' for the number of used labels to skip and how many
' copies of each label should be printed.
'================================================= ==========

Function LabelSetup()
intLabelBlanks = Val(InputBox$("Enter Number of blank labels to
skip"))
intLabelCopies = Val(InputBox$("Enter Number of Copies to
Print"))
If intLabelBlanks < 0 Then intLabelBlanks = 0
If intLabelCopies < 1 Then intLabelCopies = 1
End Function

'================================================= ==========
' The following function sets the variables to a zero
'================================================= ==========

Function LabelInitialize()
intBlankCount = 0
intCopyCount = 0
End Function

'================================================= ==========
' The following function is the main part of this code
' that allows the labels to print as the user desires.
'================================================= ==========

Function LabelLayout(R As Report)
If intBlankCount < intLabelBlanks Then
R.NextRecord = False
R.PrintSection = False
intBlankCount = intBlankCount + 1
Else
If intCopyCount < (intLabelCopies - 1) Then
R.NextRecord = False
intCopyCount = intCopyCount + 1
Else
intCopyCount = 0
End If
End If
End Function
************************************************** *********************************

Then on your label report's OnOpen event put:

=LabelSetup()

Thanks,
Ken

Mar 10 '06 #6
The approach in this function is unreliable.

Despite the fact that it is published in several books and even in one of
Microsoft's knowledgebase article, you will find that you get unreliable
results if you just print (say) page 5 of a label run. The problem is that
the report events may not fire for the intervening pages that were not
printed, so what you end up with is the wrong set of labels and possibly the
wrong count of labels.

There is another solution that relies in generating the records dynamically
in the report's query (using a Cartesian product) instead of relying on the
report's events. Details in:
Printing a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Ken Mylar" <km****@elch.org> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
I don't recall where I got this function, but it alllows you to skip
labels (if your sheet is missing some already) and also enter how many
you would like.

Create the following Module:
************************************************** ************************
Option Compare Database
Option Explicit

Dim intLabelBlanks As Integer
Dim intLabelCopies As Integer
Dim intBlankCount As Integer
Dim intCopyCount As Integer

'================================================= =========
' The following function will cause an inputbox to
' display when the report is run that prompts the user
' for the number of used labels to skip and how many
' copies of each label should be printed.
'================================================= ==========

Function LabelSetup()
intLabelBlanks = Val(InputBox$("Enter Number of blank labels to
skip"))
intLabelCopies = Val(InputBox$("Enter Number of Copies to
Print"))
If intLabelBlanks < 0 Then intLabelBlanks = 0
If intLabelCopies < 1 Then intLabelCopies = 1
End Function

'================================================= ==========
' The following function sets the variables to a zero
'================================================= ==========

Function LabelInitialize()
intBlankCount = 0
intCopyCount = 0
End Function

'================================================= ==========
' The following function is the main part of this code
' that allows the labels to print as the user desires.
'================================================= ==========

Function LabelLayout(R As Report)
If intBlankCount < intLabelBlanks Then
R.NextRecord = False
R.PrintSection = False
intBlankCount = intBlankCount + 1
Else
If intCopyCount < (intLabelCopies - 1) Then
R.NextRecord = False
intCopyCount = intCopyCount + 1
Else
intCopyCount = 0
End If
End If
End Function
************************************************** *********************************

Then on your label report's OnOpen event put:

=LabelSetup()

Thanks,
Ken

Mar 11 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: madeo | last post by:
hi, i'm looking for some script which would export address labels from a mysql db to pdf ... There's an exapmle, but i'm not able to convert it for using with mysql ... can anybody help? THX...
2
by: DBQueen | last post by:
I have a database which will be printing out labels for SMALL test tubes (1/4" high). We have yet to find a reasonably-priced printer (labelwriter) which can effectively print this on ROLLS of...
3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
3
by: Grim Reaper | last post by:
I know this is probably an easy question, but I could not find/figure it out. Basically, I am printing mailing labels with a "Sorting/Grouping" section that groups the label types together....
10
by: John Baker | last post by:
Hi: I have a user who has labels that are set up 3 across and 11 vertical (which is unusual at best), and he wants me to print names and addresses on them. I have already set up for labels 10...
2
by: ooooscar | last post by:
I'd like to make an application to print labels. I have to print an image and text, the label size is 10cm x 5 cm. I'm wandering how to do it in c#. My first thought is to make an acrobat "form"...
7
by: Bruce Lawrence | last post by:
Access 97, trying to print on Avery 5260 label sheet. I used the label wizard and told it the query to use. The results give me what I want on the label however when I hit print or print...
6
by: Ron | last post by:
Hi, I know Access allows for easy construction of a report setup to print labels from a table/query, etc. I've done that one. It works pretty well for what I need. However, is there an...
5
by: Ron | last post by:
Hi All, I've got a report that prints mailing labels. It utilizes a routine that asks the number of labels to skip, the number of each label to print, and then prints. It works really well on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.