473,394 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Printing a MS Access report in dot matrix printer

hi i have made a data entry program and want to print my report in dot matrix printer.
but the printing speed is really slow.
but when i print my dos based reports the output is really fast.
do i need to do some settings.. plz help me out with my query
Apr 26 '07 #1
11 5680
plz help me some1.....its a big problem and i cant solve it
Apr 27 '07 #2
nico5038
3,080 Expert 2GB
I see you've posted the question twice, so I'll continue here as the other thread has been closed.
Please ask the next time a moderator for action by means of a PM (Personal Message) and we'll try to find an expert to help you.

The OPEN commend can be used for opening the printer like:
Expand|Select|Wrap|Line Numbers
  1. Open "LPT1:" For Output As #1 
  2. Print #1, strLine
  3.  
You'll have to arrange however the way the strLine is filled.

Where is your data coming from ?

Nic;o)
May 1 '07 #3
I see you've posted the question twice, so I'll continue here as the other thread has been closed.
Please ask the next time a moderator for action by means of a PM (Personal Message) and we'll try to find an expert to help you.

The OPEN commend can be used for opening the printer like:
Expand|Select|Wrap|Line Numbers
  1. Open "LPT1:" For Output As #1 
  2. Print #1, strLine
  3.  
You'll have to arrange however the way the strLine is filled.

Where is your data coming from ?

Nic;o)

hi thanx for ur help my data is coming from access database only....
and ya plz tell me where to right the code.
it will be a great help coz i am stuck here and the printing process has became slow. i want the printouts only in Dot Matrix printer
May 2 '07 #4
nico5038
3,080 Expert 2GB
Assuming you have a table "tblObject" and need to print all rows you can use this code:
Expand|Select|Wrap|Line Numbers
  1. Dim rs as DAO.recordset
  2. Dim strLine as String
  3.  
  4. set rs = currentdb.openrecordset("tblObject")
  5.  
  6. Open "LPT1:" For Output As #1 
  7.  
  8. while not rs.eof
  9.    strLine = rs!fielname1 & " " & rs!fieldname2
  10.    Print #1, strLine
  11.    rs.movenext
  12. wend
  13.  
  14. Close #1
  15.  
Nic;o)
May 2 '07 #5
Assuming you have a table "tblObject" and need to print all rows you can use this code:
Expand|Select|Wrap|Line Numbers
  1. Dim rs as DAO.recordset
  2. Dim strLine as String
  3.  
  4. set rs = currentdb.openrecordset("tblObject")
  5.  
  6. Open "LPT1:" For Output As #1 
  7.  
  8. while not rs.eof
  9.    strLine = rs!fielname1 & " " & rs!fieldname2
  10.    Print #1, strLine
  11.    rs.movenext
  12. wend
  13.  
  14. Close #1
  15.  
Nic;o)

but i dont wanna print a table i want to print a report....than what should i do. and where should i write the code
May 2 '07 #6
nico5038
3,080 Expert 2GB
You asked for speeding up the process.
This is only possible by "redesigning the report" to be printed from scratch by using Print# statements.
The regular Access reports can't be speeded as they will be passed in a graphical mode and that requires (lots of) processing time.

Nic;o)
May 2 '07 #7
You asked for speeding up the process.
This is only possible by "redesigning the report" to be printed from scratch by using Print# statements.
The regular Access reports can't be speeded as they will be passed in a graphical mode and that requires (lots of) processing time.

Nic;o)
ok i understood the problem...now i have designed my report using the toolbox
how should i redesign the report now.
how can i use the print# statement to redesign it.
sorry for bothering too much but really need your help.
May 3 '07 #8
ok i understood the problem...now i have designed my report using the toolbox
how should i redesign the report now.
how can i use the print# statement to redesign it.
sorry for bothering too much but really need your help.
so there is no reply for my query
May 8 '07 #9
nico5038
3,080 Expert 2GB
True, when you want to use the Access report, speeding up the matrix printer won't be possible :-(

Just switching to the "character mode" (read Print statements) will enable faster printing, but also a complete redesign probably of your report(s).

Perhaps manipulating the settings for Black and White or Grayscale on the printer properties might have some effect, but that's hard to manage from code.

Nic;o)
May 8 '07 #10
sajuk
9
Hi, May be able to help, have in the past devised way of manipulating a query recordset to allow for faster printing through dot matrix/thermal printers.

The code I have below will allow you to run your query - which is what your report is based on within vba.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command20_Click()
  2.  
  3. Me.Requery
  4. Me.Refresh
  5.  
  6.        Dim strOrderId As String * 8 'specifies width of 8 characters
  7.        Dim strProductDescription As String * 20  'specifies width of 20 characters
  8.        Dim strQty As String * 4    'specifies width of 4 characters
  9.        Dim strUnitPrice As String * 8    'specifies width of 8 characters
  10.        Dim mydb As Database, myset As Recordset
  11.        Dim strsql As String
  12.  
  13.  
  14. strsql = "SELECT * FROM Query1 WHERE [OrderId]" & " = " & Forms!form1!OrderId & ";"
  15.  
  16.        Set mydb = CurrentDb()
  17.        Set myset = mydb.OpenRecordset(strsql)
  18.  
  19. 'Open printer
  20. Open "LPT1:" For Output As #1
  21.  
  22. Print #1, "Company Name"
  23. Print #1, "Company Address1"
  24. Print #1, "Company Address2"
  25. Print #1, "Company Address3"
  26. Print #1,
  27. Print #1, "Telephone No"
  28. Print #1, "Web Address"
  29. Print #1,
  30. Print #1, "Receipt No: " & OrderId
  31. Print #1, Date
  32. Print #1,
  33.  
  34.  
  35. 'Titles
  36.        LSet strOrderId = "OrderId"
  37.        LSet strProductDescription = "ProductDesciption"
  38.        LSet strQty = "Qty"
  39.        LSet strUnitPrice = "UnitPrice"
  40.  
  41. Print #1, strOrderId & strProductDescription & strQty & strUnitPrice
  42. Print #1,
  43.  
  44. 'Print each line of recordset
  45.  
  46.         myset.MoveFirst
  47.         Do Until myset.EOF
  48.             LSet strOrderId = myset![OrderId]
  49.             LSet strProductDescription = myset![ProductDesciption]
  50.             LSet strQty = myset![Qty]
  51.             LSet strUnitPrice = myset![UnitPrice]
  52.  
  53. 'Concatenate all of the variables together as in the following:
  54. Print #1, strOrderId & strProductDescription & strQty & strUnitPrice
  55.  
  56.             myset.MoveNext
  57.  
  58. Loop
  59.  
  60. Print #1,
  61. Print #1,
  62. Print #1,
  63.  
  64. 'Printer Autocutter
  65. Print #1, Chr$(27) & Chr$(100)
  66. 'Cashdraw Open
  67. Print #1, Chr$(7)
  68.  
  69. 'Close LPT1
  70. Close #1
  71.  
  72.         myset.Close
  73.         mydb.Close
  74.  
  75.         MsgBox "Receipt printed"
  76.  
  77. End Sub 
May 9 '07 #11
hi,
i already use this code, but when i try to run error run time error 3061 : too few parameters. Expected 2. Please advice
Jan 17 '11 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
4
by: Salad | last post by:
I'm developing an app where the print output will be on a dot-matrix printer. I suppose the printers will either be an Epson or Okidata, not really sure at this point. I, unfortunately, do not...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
2
by: Ryan Gregg | last post by:
I'm working on a project where I need to be able to print a single line at a time to a dot matrix printer. Essentially we have a log printer and each time an event occurs on the system I need to...
7
by: DazedAndConfused | last post by:
I have a 8.5 x 11 landscape document with about 1/4 inch of space on the left and right where there is no print. The document displays perfect in print preview, but when I print it, about 1/2 inch...
1
by: Paul H | last post by:
I am developing a database where some reports need to print to a laser and some need to print to a dot matrix printer. I am not interested in how to do this programmatically, I will let the user...
3
by: Rich Kayton | last post by:
I have an application that is currently a DBASE/Clipper application. We print out a variety of custom labels on Epson DOT matrix printers. I would like to be able to print these labels. I am...
1
by: Ron | last post by:
Hi All, I've got a requirement to print an existing statement printing report to another printer that's set up to print on a wide-carriage, bottom-fed dot-matrix printer. That printer's sole...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.