Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Question Unanswered: Can you print text etc directly to a printer without using a report?

    Hi all

    I am tearing my hair out possibly looking for what is not there.

    Is it possible to print text, etc directly to a printer from a command button in Access 2003 without using a form or a report?

    ie Printer.print "QWERTY"
    to the default printer

    If so could you let me have an example of code please.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    in days of old when you knew where a printer was attached you could write printer specific code direct to the report. but thats not really the windows way of doing things

    whats stopping you send stuff to a report. a report doesn't have to be bound, you can add or populate controls as required. you could open the report through the docmd macro, set appropriate parameters as part of the opening arguments
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2012
    Posts
    4
    thanks for your comments.

    What I am trying to do is print to a 40 character till printer to give customers receipts..

    I have tried to make a report to do the job but it did not fit properly.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you can't make it work as a standard access reprot, then you may well have to dfo some tinkering yourself, sending the appropriate control codes to the printer as part of the data stream

    as its a dedicated printer attached tot eh computer then you mjay well be able to address the printer directly. Im guessing its gong to be US or serial. serial used to be the best option but few devices support serial these days so you may well be forced to go downt he route of a USB to serial conveerter which addds anothert layer of cmplexity and scope for errors


    yopu should be able though to design a report that works.
    set the paper size
    set the correct font
    and away y'go
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jan 2012
    Posts
    4
    Hi thanks for that. I have played more with reports which might work but can the end of report be suppressed or made never ending to use on a till roll.

    I would prefer to write code to address the printer directly but the code escapes me.

    I have coded to alter the default printer to my target 'Star 200' but what code directs the printer to print?

    I guess

    Printer.????? "text" but what is ?????? for an access 2003 datebase?

Tags for this Thread

Posting Permissions

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