Solved

NEED SOME BODY TO TEST THIS CODE

Posted on 2001-06-06
3
149 Views
Last Modified: 2010-05-02
Hi peeps,

Need somebody to cut and paste the code below and try it on a dot matrix printer.

it must be a dot matrix.

I dont have one and I need to start writing this printer module for a client.

CREATE A COMMAND BUTTON & paste the code

Private Sub Command1_Click()
Open "c:\database\paidbase.dat" For Input As 1
Printer.Print "Complete paid report"
While Not EOF(1)
Input #1, NOTENUMBER, DELIVERY, SERVICE, ITEMS, COMPANY, ADD1, ADD2, ADD3, LOCATION, POSTTOWN, postcode, NOTES1, despatchref, WEIGHT, CODATE, PAIDDATE, paidby
Printer.Print Tab(1); despatchref; Tab(25); COMPANY
Wend
Close #1
End Sub

YOU WILL ALSO need to change the path and the variables.

i just need to know that the printer.print method ive used will work. so please dont change this to much.

if anybody can show a 100% way of printing to the dot matrix without any errors then that wouls be appricated.

right im off to work.

ill read the comments at work when my boss has vanished.
lol

cheers
andy
0
Comment
Question by:Microsoft
3 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 6159518
can you speak up a little?
0
 
LVL 2

Author Comment

by:Microsoft
ID: 6159690
can i speak up ???????

tell me more
0
 
LVL 6

Accepted Solution

by:
sharmon earned 80 total points
ID: 6161567
I don't have your dat file so I couldn't try it exactly, but here is a similar routine that works just fine.  The only thing I seen missing from yours was Printer.EndDoc

Sub PrinterTest()
  Dim fld1(2) As String
  Dim fld2(2) As String
 
  fld1(0) = "Test 1"
  fld2(0) = "Company 1"
  fld1(1) = "Test 2"
  fld2(1) = "Company 2"
  fld1(2) = "Test 3"
  fld2(2) = "Company 3"
 
  Printer.Print "Complete paid report"
 
  Dim i As Integer
  For i = 0 To 2
    Printer.Print Tab(1); fld1(i); Tab(25); fld2(i)
  Next i

  Printer.EndDoc
End Sub
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now