Bob, here's an entire vba module that I use to print to a legacy Epson LQ500
printer. Probably you can determine the correct escape sequence to reset the
LX300 and use this code to send it to the printer. This code requires the
printer to be attached to the parallel port.
What's a little strange in the sideways print problem is that when the
printer is shut off and then turned back on, it will initialize to default
settings. In order to print sideways, some existing software must be sending
an escape sequence that puts the printer into graphics mode (there is no
native sideways font).
The LQ500 supports a self test. With paper loaded and the printer OK to
print, turn it OFF. While holding down the line-feed button, turn the
printer ON and release the line-feed button. To stop the self test, press
the on-line button. I suspect that all this applies to the LX300 also.
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