Becker, below is a module that I use to bypass Windows print drivers
entirely for printing to a dot matrix printer. If you know the esc
sequences, you have total control over how to initialize and print to the
printer. Maybe you can use this as a guide to figure out your printer.
UpRider
Option Compare Database
Option Explicit
'PRINT TO LPT PORT TO EPSON 500
'---------------------------------------------------------------------------------------
' Procedure : subPrintDotMatrixLabels
' DateTime : 7/16/2002 10:19
' Author : David
' Purpose : Access reports always eject a page at eoj, which wastes
tractor feed labels.
' : This sub prints directly to lpt1 a line at a time.
' : myquery is the data source for the labels, arg controls type
of label to print;
' : 0 or null - print regular label
' : 1 - print sticker label to ask for new email address
'---------------------------------------------------------------------------------------
'
Sub subPrintDotMatrixLabels(myquery As String, Optional arg As Integer)
Dim intBlankline As Integer
Dim X As Integer
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
On Error GoTo subPrintDotMatrixLabels_Error
Set db = CurrentDb()
Set qdf = db.QueryDefs(myquery)
Set rst = qdf.OpenRecordset()
Open "LPT1" For Output As #1
'Initialize printer, Epson 500
Print #1, Chr(27) + Chr(120) + "1" + Chr(27) + Chr(67) + "6" + Chr(27) +
Chr(77)
' Print #1, Chr(27) + Chr(77)
Select Case arg
Case 0
Do While Not rst.EOF
intBlankline = 3
Print #1, LTrim(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
'advance 5 lines (1 label)
intBlankline = 5
For X = 1 To intBlankline
Print #1, " "
Next X
Close #1
Case 1
Do While Not rst.EOF
Print #1, LTrim(rst![FIRST] & " " & rst![LAST])
Print #1, rst![ME_MAIL]
Print #1, "Your Emailed Newsletter bounced. Please"
Print #1, "update your email addr at
www.dbtc.org"
Print #1, " "
Print #1, " "
'print #1, " "
rst.MoveNext
Loop
'advance 5 lines (1 label)
intBlankline = 5
For X = 1 To intBlankline
Print #1, " "
Next X
Close #1
End Select
subPrintDotMatrixLabels_Exit:
On Error Resume Next
rst.Close
Set rst = Nothing
Set qdf = Nothing
Set db = Nothing
Exit Sub
subPrintDotMatrixLabels_Error:
Call fcnLogError(Err.Number, Err.Description, "Procedure
subPrintDotMatrixLabels" & " of basLPTprint", , True)
Resume subPrintDotMatrixLabels_Exit
End Sub
becker said:
Using: Windows 2000 Professional - Access 2000 - Okidata Printer ML 395 -
14
7/8 x 11 Green Bar
Problem: a) cannot get the printer to print all the way across the green
bar paper (there are no 14 7/8 x 11 setting in the "Page Setup")
b) printer prints with 2 passes for the same line (it overprints the same
characters)
c) cannot get the printer to print bi-directional (I want it to print left
to right for one line and right to left on the next line
History: Went throught the Access Software manual (no help) - Went
through
the printer manual [Access software should control the printer totally (no
help) - Talked to windows people (no help) - talked the the Oki people (no
help) -
talked to the Epson people because Oki uses the Epson emulation (no help)
This appeal the the Discussion Group is my last recourse........ Please
help!