printing plain text from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am converting an old DOS application to an Access application. One of the
primary purposes of the application is to generate invoices (lots of them) on
preprinted tractor-feed forms using a dot matrix printer.

The output to the printer needs to contain control codes to set and reset
the printer's fonts, so I don't want the output going through the usual
Windows print drivers. I just want to send a stream of data straight to the
printer, as a DOS application would.

What's the best way to accomplish this with Access? I'm thinking that I
need to create a plain text file first (easy enough), then send it to the
printer (and that's what I can't quite figure out how to do). Am I on the
right track here?
 
If you have a Windows driver for the printer, you could consider using an
Access 'Report'. This allows precise control over field positions, fonts
etc. I use this to print invoices (admittedly not tractor feed but that
shouldn't make much difference).

Robin
 
FolkDude said:
I am converting an old DOS application to an Access application. One of the
primary purposes of the application is to generate invoices (lots of them) on
preprinted tractor-feed forms using a dot matrix printer.

The output to the printer needs to contain control codes to set and reset
the printer's fonts, so I don't want the output going through the usual
Windows print drivers. I just want to send a stream of data straight to the
printer, as a DOS application would.

What's the best way to accomplish this with Access? I'm thinking that I
need to create a plain text file first (easy enough), then send it to the
printer (and that's what I can't quite figure out how to do). Am I on the
right track here?


Most people throw the preprinted forms (and the printer)
away and recreate it in a report.

However, there is no way to get a report to output the
printer control codes so, if you feel you really must use
the old tractor feed forms/printer, then creating a text
file is probably the way to go. If there is only one
machine doing this and it is connected directly to the
printer, you might want to try bypassing the file and write
directly to the Com port.
 
Marshall Barton said:
Most people throw the preprinted forms (and the printer)
away and recreate it in a report.

Yes, that would be my preference, but the user has already made a
significant investment in a large inventory of preprinted forms and a new
high-speed printer. The printer is less than a year old. They're not going
to like the idea of throwing it away. :-)
However, there is no way to get a report to output the
printer control codes so, if you feel you really must use
the old tractor feed forms/printer, then creating a text
file is probably the way to go. If there is only one
machine doing this and it is connected directly to the
printer, you might want to try bypassing the file and write
directly to the Com port.

This will indeed be a single machine, with a direct connection to the
printer (I'm pretty sure it's a parallel interface). How would I write
directly to the printer port from Access?
 
FolkDude said:
Yes, that would be my preference, but the user has already made a
significant investment in a large inventory of preprinted forms and a new
high-speed printer. The printer is less than a year old. They're not going
to like the idea of throwing it away. :-)


This will indeed be a single machine, with a direct connection to the
printer (I'm pretty sure it's a parallel interface). How would I write
directly to the printer port from Access?


Instead of using:
Open "path to text file" For Output As #x
use:
Open LPT1 For Output As #x

Also check Help on FreeFile, Write, Print and Close
 
Marshall Barton said:
Instead of using:
Open "path to text file" For Output As #x
use:
Open LPT1 For Output As #x

Also check Help on FreeFile, Write, Print and Close

Thank you! I think that's the solution I need.
 
Back
Top