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
Open "LPT1" For Output As #1
Do While Not rs.EOF
Print #1, rs!NAMA_BARANG
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.
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.
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?
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.
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.