Is it possible to print varying numbers of labels from Access? 6 2214
On 9 Mar 2006 19:48:18 -0800, "MJ" <je*******@cox. net> wrote:
Yes.
For i = 0 to Rnd(1000)
Docmd.OpenRepor t "myLabelRep ort"
Next i
Or clarify your question.
-Tom. Is it possible to print varying numbers of labels from Access?
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.
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.MyQuantityFi eld
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.
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
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.or g> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 a lot
Martin :)
|
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 labels....due to slippage, soon
you have the printout missing the label. So we are thinking that we have to
use sheets of labels.
HOWEVER, one job may need 15 labels, another may need 8, etc.
Does anyone have a solution for how to set this up in...
|
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 using a report I created and then printing them on
a continuous-feed dot matrix printer. I used the Label Wizard, chose the
query I created, picked the 'Avery USA 4146' (1 7/16" x 4") - 3 across,
paper size: 'Fanfold 358mm x 12 in', and Printer:...
|
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. Also, I am using a "Report Header" to
show a count of how many total labels that are being printed.
Now, my problem is that without the "Report Header", the spacing is perfect.
But, when I add the Report Header, it gets shifted downwards and the...
|
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 vertical and 3 across (Avery 5160)which are another standard the user has, but
can't find any in the setup for labels that show 11 vertical. I am therefore using the
Avery 5160 as a start, and modifying the top and bottom margins (the margins on the...
| |
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" with the image and text, but I
have to send a date in the label so I need to open the pdf and send the date
into a field (variable), then I have to print n times the same label.
Can anyone help me ?
Thank's.
|
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 preview,
all I see is 1 label in the upper left corner. Why isn't the entire
sheet filled with the same information as what is in the first label?
I want every label to ahve the same information in it.
Thanks
|
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 example anywhere that someone can point me to that is
more flexible?
And, I mean flexible in this regard:
|
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 a print preview. But,when I print to
the printer it disregards the number of labels to skip.
I preview all the reports I've got and then have a little printer icon to
click on if the user wants to actually print (my attempt at saving trees)....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |