S
Sunny
Dear experts,
I would like to ask if it is possible to print text to a Epson customer/line
display by using MS Access2007 VBA. Could you kindly give one example?
Because i found below sample VB coding(by Epson) doesn't work in VBA. Many
thanks! /Sunny
-------------------------------------------------------------------
' Constant variable holding the Display name.
Private Const DISPLAY_NAME = "EPSON DM-D110/120/210"
' Constant variables holding the control command characters.
Private Const CMD_CLEAR = "a"
Private Const CMD_BLINK = "de"
Private Sub Form_Load()
Dim printerObj As Printer
' Loop through the Printers and set the Printer object to the indicated
display.
For Each printerObj In Printers
If printerObj.DeviceName Like "*" + DISPLAY_NAME + "*" Then
Set Printer = printerObj
Exit For
End If
Next
End Sub
' The executed function when the Position button is clicked.
Private Sub cmdPosition_Click()
'Clear the display first.
Printer.FontSize = 7
Printer.Font = "Control"
Printer.Print CMD_CLEAR
' Send the string to the Display with DM-D 1st Line or DM-D 2nd Line font,
' depending on the choosen line by the user.
If optLine.Item(0).Value = True Then
Printer.Font = "DM-D 1st Line"
Else
Printer.Font = "DM-D 2nd Line"
End If
Printer.Print "Hello APD!"
Printer.EndDoc
End Sub
I would like to ask if it is possible to print text to a Epson customer/line
display by using MS Access2007 VBA. Could you kindly give one example?
Because i found below sample VB coding(by Epson) doesn't work in VBA. Many
thanks! /Sunny
-------------------------------------------------------------------
' Constant variable holding the Display name.
Private Const DISPLAY_NAME = "EPSON DM-D110/120/210"
' Constant variables holding the control command characters.
Private Const CMD_CLEAR = "a"
Private Const CMD_BLINK = "de"
Private Sub Form_Load()
Dim printerObj As Printer
' Loop through the Printers and set the Printer object to the indicated
display.
For Each printerObj In Printers
If printerObj.DeviceName Like "*" + DISPLAY_NAME + "*" Then
Set Printer = printerObj
Exit For
End If
Next
End Sub
' The executed function when the Position button is clicked.
Private Sub cmdPosition_Click()
'Clear the display first.
Printer.FontSize = 7
Printer.Font = "Control"
Printer.Print CMD_CLEAR
' Send the string to the Display with DM-D 1st Line or DM-D 2nd Line font,
' depending on the choosen line by the user.
If optLine.Item(0).Value = True Then
Printer.Font = "DM-D 1st Line"
Else
Printer.Font = "DM-D 2nd Line"
End If
Printer.Print "Hello APD!"
Printer.EndDoc
End Sub