Results 1 to 20 of 20

Thread: Printing the contents of a access table

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10

    Question Printing the contents of a access table

    In my present situation, I need to print the contents of a access 2000 table out to a receipt printer using vb6. The table is already layed out with everything aligned properly.

    Anyone have any ideas on how to accomplish this?

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    receipt printer ?
    -= a peet post =-

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    Yes a receipt printer. This will be printed automatically upon completion of the transaction (purchase). I do not want to see a print preview, just print the receipt.

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    use vb print function? is that an option ?
    -= a peet post =-

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim p As Printer
    3.     p.Print "blabla"
    4.     p.Print "some more blabla"
    5.     p.EndDoc
    6. End Sub
    -= a peet post =-

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    You mean something like "Printer.print"? When I try this in access I come up with an error that reads "Variable not Defined".

  7. #7
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by Chuck Phillips
    You mean something like "Printer.print"? When I try this in access I come up with an error that reads "Variable not Defined".
    did u try declaring a var as printer (see above sample) ?
    -= a peet post =-

  8. #8
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    uh... inside access.. tried it myself.. didn't work at all
    -= a peet post =-

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    just attempted your suggestion and received a "User-Defined type not defined" error.

    'print receipt functions
    Dim p As printer
    p.Print rstRECEIPT

    this is what my code looks like. the "p As printer" is highlighted

  10. #10

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    Tommorow (Friday) I actually go onsite for testing and debugging and this is the last stumbling block I have to overcome.

  11. #11
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    yes, I noticed (above post)

    I didn't realise that VBA didn't have such object ... sorry... Thought u were doing it from VB.

    Could u not create a report instead, and print that?
    -= a peet post =-

  12. #12
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by Chuck Phillips
    Tommorow (Friday) I actually go onsite for testing and debugging and this is the last stumbling block I have to overcome.


    we must try to overcome it then
    -= a peet post =-

  13. #13
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    so u'r entire app is created in Access?
    -= a peet post =-

  14. #14

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    I actually have a report generated at present. The only problem is that the form prints on 8 1/2 x 11 paper. If you attempt to print the report on a receipt printer paper (exact size not known but quite a bit smaller) the words wrap around the receipt.

  15. #15

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    actually the original is written in FoxPro for DOS. Our client has purchased a new accounting software (written in access) and they are in need of the FoxPro program to be rewritten in access. They want a windows based environment, as well as all the tables being together.

  16. #16
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    isnt there a special driver for this printer ?

    a printer u can select when doing print?
    -= a peet post =-

  17. #17

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    I dont believe so. Just a simple plug and go printer. I will find out for sure tomorow

  18. #18

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    10
    I must get going now but if you can think of anything please post here as I will check in the morning. Thanks for your time and help. Gonna go home and think on this.

  19. #19
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    sounds like a special kind of printer to me, like a lable printer.

    One of my colleagues programmed one of those.
    I think what he had to do was feeding the printer using some spesial chars and the data he wanted to print.

    If u'r not sure what printer it is, it would be a bit difficult
    -= a peet post =-

  20. #20
    ALFWare
    Guest

    Lightbulb Receipt Printers...

    Reciept printers are standard text based printers, they do not require any special driver. You can use the standard text based printer driver from windows if you want.

    All you do is send text to the LPT port it is connected to, Haven't played with VB and this though but an example off the good old days would be like

    dir > lpt1

    and all the text that gets displayed is sent to the LPT1 port which the printer can handle fine. Reciept Printers are measured in Col size so most times it is a 80 column or 23 column so on and that is the max chars allowed across the width. Hope this helped a little.

Posting Permissions

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



Click Here to Expand Forum to Full Width