473,418 Members | 1,749 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,418 software developers and data experts.

Print new record to label printer

al
Hi
I need to automaticaly print new records/reports in an Access database
to a labelprinter. Can this be done?

The records are added with asp code.

The Labelprinter is a Brother QL-550

Best Regards
Anders Lorentzen

Nov 13 '05 #1
9 7921
1. Open your report in design view.

2. Choose Page Setup on the File menu.

3. On the Page tab of the dialog, choose Use Specific Printer, and select
the printer.

4. Save the report. It will now remember to go to this printer.
--
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.

<al@it.dk> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi
I need to automaticaly print new records/reports in an Access database
to a labelprinter. Can this be done?

The records are added with asp code.

The Labelprinter is a Brother QL-550

Best Regards
Anders Lorentzen

Nov 13 '05 #2
al
Ok, but not quite what I was looking for. I need Access to print the
label without i have to click the "Print" button.
I need tohave the label printet at the moment the new record is added,
without interaction.

Anders Lorentzen

Nov 13 '05 #3
N J
<al@it.dk> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Ok, but not quite what I was looking for. I need Access to print the
label without i have to click the "Print" button.
I need tohave the label printet at the moment the new record is added,
without interaction.

Anders Lorentzen


Couldn't this be done using an On Update event, or something along those
lines?
So when the record is altered, a report is printed?
Nov 13 '05 #4
al
Can you give a clue on how to do that, im not that much of an Access
guy. :)

Anders Lorentzen

Nov 13 '05 #5
Use the After Insert event of your form. That's the event that fires when a
new record gets added.

In that event, use the OpenReport action to fire off the printing of the
label.

Your next question is going to be how to print just the new record, not all
of them. You will need to understand some VBA code to achieve that, but see:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
The article expects you will use the Click event of a command button to do
that, but you will be using Form_AfterInsert.

Unless your label takes up a whole page, your next question is going to be,
"How can I print the next label, and not feed the whole sheet?" You can then
dig yourself in further with code from this article:
http://support.microsoft.com/default...b;en-us;231801

Ultimately, I don't think it will be productive for you.

--
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.

<al@it.dk> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Can you give a clue on how to do that, im not that much of an Access
guy. :)

Anders Lorentzen

Nov 13 '05 #6
al
Thank you for your input. I will go throug it and return if there is
further questions.

The label takes up a hole sheet - or rather it's a small one sheet
sticker. The report is ready and the printing of one label works (if i
choose pages 1 - 1.)

Anders Lorentzen

Nov 13 '05 #7
al
I have worked something out now, the label is showed and printet
correctely, but I have a few problems.

1) The AfterInsert is only envoked when I Add a record from myform, not
when I add a record through .asp.
2) The Report is not printet, only displayed as a prewiev.

Is it possible to solve these two problems?

Anders Lorentzen

The code used is:

Private Sub Form_AfterInsert()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "LabelBuy", acViewPreview, , strWhere
End If
End Sub

Nov 13 '05 #8
Re 1, Access has no triggers, so there is no way to have it respond to new
records as they come in through ASP, only through the events of the form.

Re 2, change acViewPreview to acViewNormal.

--
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.

<al@it.dk> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have worked something out now, the label is showed and printet
correctely, but I have a few problems.

1) The AfterInsert is only envoked when I Add a record from myform, not
when I add a record through .asp.
2) The Report is not printet, only displayed as a prewiev.

Is it possible to solve these two problems?

Anders Lorentzen

The code used is:

Private Sub Form_AfterInsert()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "LabelBuy", acViewPreview, , strWhere
End If
End Sub

Nov 13 '05 #9
al
Ok, thank you, I just learned a bunch of new things about Access. :)

I will try to work out the problem an other way.

Anders Lorentzen

Nov 13 '05 #10

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

Similar topics

1
by: mcmahongg | last post by:
Hi I want to print to a Seiko SLP 220 printer from PHP (printer is connected to COM1; and works fine via the Seiko label print application program). I've tried code like : $str = "Sample...
2
by: Wolfgang Huell | last post by:
Hi Guys. I hope somebody is able to help me with this one: Task: Client (intranet) sends form to webserver (asp or asp.net). Webserver stores user input in database and retrieves record id....
0
by: Matthew Belk | last post by:
I am trying to print some 2x6 labels on a SATO CL408e thermal label printer. The 2x6 labels are arranged in "landscape" mode with 2 labels per "sheet." When I attempt to print "x" copies of a 1...
1
by: achintya.jha | last post by:
Hi, I am currently working hard to print Word labels from ASP.NET I have multiple records which I need to print on to a word label print functionality. I know that Word Label printing prints...
56
by: peng | last post by:
Hi, I am development a project using C#.Net. Inside application, it needs to print labels on different Zebra label printers on the network. I used a shell script, but it only worked on the...
13
by: ATJaguarX | last post by:
I have a Zebra S500 and multiple S600 label printers. http://www.zebra.com/id/zebra/na/en/index/products/printers/industrial_commercial/s600.html They are currently being used in our legacy...
12
by: Jchick | last post by:
Boy, this should be a simple bit of code but I can't figure out how to make it happen. I have a CSV file shows up in a directory that has 4 fields that need to be printed on labels. Each line of...
24
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available...
1
by: scotter86 | last post by:
Hi everyone, I have kind of an odd question. What I'm trying to do is have a program run when I want to print something. A little background on my situation is, I'm sharing a little thermal...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
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...
0
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...

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.