By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,240 Members | 782 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,240 IT Pros & Developers. It's quick & easy.

Print new record to label printer

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.