Thermal Receipt Printer problem

brianell

New member
Local time
Today, 13:02
Joined
Mar 13, 2009
Messages
9
Hi,

I am using a POS system I wrote 2 years back in Access 2000

I have acquired a thermal receipt printer for my POS program. It prints on a 80mm wide strip of thermal paper. It's drivers offer certain paper sizes and cut options which Access 2000 does not seem to like. I get a message "cant print or preview because the page size you selected is larger than 22.75 inches", which it isn't :) I gatehr from hours of googling, this a default error message for page sizes that are not supported by Access.

I gatehr the solution to my problem is in a VBA module, but I have no idea how to fix this. Any Help will be greatly appreciated.

Brian
Mutare
Zimbabwe (Don't ask!!!! :eek: )
 
I gather this is what I need, but have no idea how to modify this to suit a "page" of 80mm x 3276mm (roll length).

Code:
Option Compare Database
Option Explicit
'*********************************************
' Author:  Jim Bonacorda, MIS
' Phone:  732-721-5544 ext 3166
' E-mail: [EMAIL="jbonacorda@sabert.com"]jbonacorda@sabert.com[/EMAIL]
' Created:  11/20/2002
' The purpose of this module is to manage the
' printer settings for reports in this application
'*********************************************
Const MOD_NAME$ = "Module modPrinterMgmt"

Type str_DEVMODE
    RGB As String * 94
End Type

Type type_DEVMODE
    strDeviceName As String * 16
    intSpecVersion As Integer
    intDriverVersion As Integer
    intSize As Integer
    intDriverExtra As Integer
    lngFields As Long
    intOrientation As Integer
    intPaperSize As Integer
    intPaperLength As Integer
    intPaperWidth As Integer
    intScale As Integer
    intCopies As Integer
    intDefaultSource As Integer
    intPrintQuality As Integer
    intColor As Integer
    intDuplex As Integer
    intResolution As Integer
    intTTOption As Integer
    intCollate As Integer
    strFormName As String * 16
    lngPad As Long
    lngBits As Long
    lngPW As Long
    lngPH As Long
    lngDFI As Long
    lngDFr As Long
End Type

Sub sSwitchPaperSizeToLegal(rptName As String)
'The purpose of this sub is to set the page size
'for a report to legal
Const SUB_NAME$ = "sSwitchPaperSizeToLegal"
Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
Dim strDevModeExtra As String
Dim rpt As Report

    'Open report in design view.
    DoCmd.OpenReport rptName, acDesign    'Open report in Design view.
    Set rpt = Reports(rptName)
    If Not IsNull(rpt.PrtDevMode) Then
        strDevModeExtra = rpt.PrtDevMode   ' Get current DEVMODE structure.
        DevString.RGB = strDevModeExtra
        LSet DM = DevString
        DM.lngFields = DM.lngFields Or DM.intPaperSize Or DM.intPaperLength Or DM.intPaperWidth
        DM.intPaperSize = 5    'legal
        DM.intPaperWidth = 8.5 * 254    '8.5 inches
        DM.intPaperLength = 14 * 254  '14 inches
        LSet DevString = DM    'Update property.
        Mid(strDevModeExtra, 1, 94) = DevString.RGB
        rpt.PrtDevMode = strDevModeExtra
    End If
    DoCmd.Close acReport, rptName, acSaveYes

End Sub
 
This maybe a silly question, but in the report page setup, have you set the printer to the thermal printer, and the page size to the label size?
 
Hi Andy,

Yes, under "Page Setup", the page size is selected. The printer driver offers 80mm x xxxxxx, xxxxxx being various lengths and cut/feed options. My understanding of this problem is that Access does not (by default) support these odd page sizes, hence the need for a VBA solution to this problem.

Regards
Brian
Mutare
Zimbabwe
 
cant you set a custom page size.

there may also be a "standard" printer, as i shouldnt think you want any fancy control strings to be sent to the printer


eg you used to be able to set any printer as "epson" in the good old dot matrix days
 
Thanks, changing the page size in the Page Setup solved the problem. Seems Access 2000 does not like a the drivers default setting of 80mmx 3295mm. Gives the error message of the page being over 22.75" in size. I have set to 80mm x 295mm (another option offered by the driver) and it works perfectly.
 

Users who are viewing this thread

Back
Top Bottom