Results 1 to 4 of 4
  1. #1
    Business is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    78

    POS Applcation printing on thermal printer

    Hi,
    its me again,i ve been googling and checking for the solution at my pb but i still don t get it rigth.
    I have developped a POS application and it s connected to a printer and cash drawer.
    i got a form invoice with fields and i would like some of this field to be printed without having to pass by the report.
    I m sure there is a programming way to get it rigth but untill now i do not get it.
    At least i have manage for the cash drawer by creating a module and calling it in the after update of one field
    Please can you clarify me by giving me some help.


    regards

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The information you find here:

    http://answers.microsoft.com/en-us/o...5-16bd02311d06

    should point you in the right direction.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  4. #4
    Business is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    78
    Thanks a lot guys,but there is still a small pb,following the John G link the printer happend to respond but nothing is printed.It is just working but without printing nothing.
    As said i ve added a button to my form and on the form i use this code
    Private Type DOCINFO
    pDocName As String
    pOutputFile As String
    pDatatype As String
    End Type

    Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
    Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
    Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
    Private Declare Function OpenPrinter Lib "winspool.drv" Alias _
    "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, _
    ByVal pDefault As Long) As Long
    Private Declare Function StartDocPrinter Lib "winspool.drv" Alias _
    "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _
    pDocInfo As DOCINFO) As Long
    Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
    Private Declare Function WritePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, _
    pcWritten As Long) As Long
    On the button i used
    Private Sub Command1_Click()
    Dim lhPrinter As Long
    Dim lReturn As Long
    Dim lpcWritten As Long
    Dim lDoc As Long
    Dim sWrittenData As String
    Dim MyDocInfo As DOCINFO
    lReturn = OpenPrinter(Printer.DeviceName, lhPrinter, 0)
    If lReturn = 0 Then
    MsgBox "The Printer Name you typed wasn't recognized."
    Exit Sub
    End If
    MyDocInfo.pDocName = "AAAAAA"
    MyDocInfo.pOutputFile = vbNullString
    MyDocInfo.pDatatype = vbNullString
    lDoc = StartDocPrinter(lhPrinter, 1, MyDocInfo)
    Call StartPagePrinter(lhPrinter)
    sWrittenData = "Businessoft" & vbFormFeed
    lReturn = WritePrinter(lhPrinter, ByVal sWrittenData, _
    Len(sWrittenData), lpcWritten)
    lReturn = EndPagePrinter(lhPrinter)
    lReturn = EndDocPrinter(lhPrinter)
    lReturn = ClosePrinter(lhPrinter)
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Thermal printer
    By Business in forum Access
    Replies: 2
    Last Post: 05-26-2016, 01:54 PM
  2. Thermal printer Slow printing
    By Nasir Ali in forum Programming
    Replies: 2
    Last Post: 05-28-2014, 08:13 AM
  3. Replies: 0
    Last Post: 01-09-2013, 10:52 AM
  4. Setting Printer when Printing Report
    By russ0670 in forum Reports
    Replies: 3
    Last Post: 05-12-2010, 09:45 AM
  5. Printing to an intermec printer from access
    By dkalsow in forum Programming
    Replies: 3
    Last Post: 12-16-2009, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums