Results 1 to 7 of 7

Thread: problems help!!

  1. #1
    Join Date
    Dec 2003
    Posts
    49

    Unanswered: problems help!!

    i have used this code to print my invoice directly to the printer :
    Dim rs As DAO.Recordset
    Set rs = Me.[JUAL SUBFORM].Form.RecordsetClone
    rs.MoveFirst
    Open "LPT1" For Output As #1

    Do While Not rs.EOF
    Print #1, rs!NAMA_BARANG
    rs.MoveNext
    Loop
    Close #1

    the problem is :
    the default printer fontsize is 10. i want to decrease or increase the font size how can i do this? is there somekind of code to set the default font size of the printer?
    i use EPSON LX-800 dot matrix printer.

    thank you
    hendra gunadi

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    There are code commands you can send directly to the printer but you will need to check your printer manual (usually near the rear of the manual) to get these commands which are usually called Escape Codes. Keep in mind though...for a lot of printers, the commands only work for fonts that are built directly into the printer's firmware.

    You could accomplish the same thing by simply creating your invoice as a Access report form and then resizing the font directly for the control(s) of your report. This can be done from within the OnFormat event of the Invoice report.

  3. #3
    Join Date
    Dec 2003
    Posts
    49
    thank you.
    i've found the escape codes for my printer. but i can't figure out how to use it . for example the codes form select italic characters :
    ASCII : ESC 4
    DECIMAL: 27 52
    HEX : 1B 34
    KEYBOARD :CTRL [ 4
    Could you give me some example to use this codes?
    which would you prefer ?
    1. use a report to print the invoice
    2. use the print command to send character directly to the printer?

    thank you.
    hendra gunadi

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Sheesh....it must be at least fifteen years gone since I last used printer Escape Codes. If I recall, you need to pass a Chr$(0) (Null) to the printer before the actual escape code (I can't remember). For example:

    Print #1, Chr$(0) + Chr$(EscapeCode)

    I recommend that you make your Invoice a Access report. There is much more flexability that way and much easier to use and manipulate.

  5. #5
    Join Date
    Dec 2003
    Posts
    49
    could you give me some example to use a report ?
    i'm confused because in the wordpad there's draft10cpi font but not in the access report properties. it seems access report properties only "see" fonts in c:/windows/fonts only. i'm able to print draft10cpi in the wordpad, but not in the access report.
    thanks for your information i really appreciate this.
    hendra gunadi

  6. #6
    Join Date
    Nov 2003
    Posts
    1,487
    And here (attached) is the report itself in a blank mdb file.
    Attached Files Attached Files

  7. #7
    Join Date
    Nov 2003
    Posts
    1,487
    First off...the draft10cpi font you are using is most likely not a Windows True-Type font. If it is then you should be able to add it to MSAccess.

    Attached is a picture (.bmp) of a sample invoice I created a few years ago. It can give you an idea of what you can do in Access.
    Attached Thumbnails Attached Thumbnails invoice.jpg  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •