How to print a single line to printer driver

  • Thread starter Thread starter Daryl
  • Start date Start date
D

Daryl

Dear All,

I am trying to print a single line to a line printer each time when the
operator finish the transaction. I don't know how to send a single line to
line printer using its own printer driver on Windows XP? Can anyone help? I
tried to use Access report to do it, but everytime it prints 1 page for 1
line, it is not what I want. Please help.


Thank you in advance.
 
Daryl said:
Dear All,

I am trying to print a single line to a line printer each time when
the operator finish the transaction. I don't know how to send a
single line to line printer using its own printer driver on Windows
XP? Can anyone help? I tried to use Access report to do it, but
everytime it prints 1 page for 1 line, it is not what I want. Please
help.


Thank you in advance.

I am not sure you can do this will all printers. For example a laser
printer.
 
Daryl said:
I am using EPSON dot matrix line printer, is it possible?

It should be, but the last time I did it was in the old DOS days. I
think I may still have the codes for that, but I suspect they would not work
in today's systems.
 
Daryl, here's a sub I use to print labels to an Epson 500. Access reports
always eject a page at the end of the report. That wastes a lot of labels
when printing only one. This routine prints a line at a time and won't page
eject, just one blank label at end. You can use this for your starting
point for your needs....

HTH
UpRider

'PRINT TO LPT PORT TO EPSON 500
Sub subPrintLabels(myquery)
Dim intBlankline As Integer
Dim x As Integer

Dim Db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Set Db = CurrentDb()
Set qdf = Db.QueryDefs(myquery)
Set rst = qdf.OpenRecordset()

Open "LPT1" For Output As #1
'initialize the printer
Print #1, Chr(27) + Chr(120) + "1" + Chr(27) + Chr(67) + "6" + Chr(27) +
Chr(77)
Do While Not rst.EOF
intBlankline = 3
Print #1, rst![FIRST] & " " & rst![LAST]
Print #1, rst![ADDR1]
If Len(rst![ADDR2]) > 0 Then
Print #1, rst![ADDR2]
intBlankline = intBlankline - 1
End If
Print #1, rst![CITY] & " " & rst![ST] & " " & rst![ZIP]
For x = 1 To intBlankline
Print #1, " "
Next
rst.MoveNext
Loop
intBlankline = 5
For x = 1 To intBlankline
Print #1, " "
Next x
Close #1
End Sub
 
Thank you very much for all yours help. I will try... Thanks again


Regards,
Daryl

UpRider said:
Daryl, here's a sub I use to print labels to an Epson 500. Access reports
always eject a page at the end of the report. That wastes a lot of labels
when printing only one. This routine prints a line at a time and won't page
eject, just one blank label at end. You can use this for your starting
point for your needs....

HTH
UpRider

'PRINT TO LPT PORT TO EPSON 500
Sub subPrintLabels(myquery)
Dim intBlankline As Integer
Dim x As Integer

Dim Db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Set Db = CurrentDb()
Set qdf = Db.QueryDefs(myquery)
Set rst = qdf.OpenRecordset()

Open "LPT1" For Output As #1
'initialize the printer
Print #1, Chr(27) + Chr(120) + "1" + Chr(27) + Chr(67) + "6" + Chr(27) +
Chr(77)
Do While Not rst.EOF
intBlankline = 3
Print #1, rst![FIRST] & " " & rst![LAST]
Print #1, rst![ADDR1]
If Len(rst![ADDR2]) > 0 Then
Print #1, rst![ADDR2]
intBlankline = intBlankline - 1
End If
Print #1, rst![CITY] & " " & rst![ST] & " " & rst![ZIP]
For x = 1 To intBlankline
Print #1, " "
Next
rst.MoveNext
Loop
intBlankline = 5
For x = 1 To intBlankline
Print #1, " "
Next x
Close #1
End Sub

Joseph Meehan said:
It should be, but the last time I did it was in the old DOS days. I
think I may still have the codes for that, but I suspect they would not
work in today's systems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top