Results 1 to 7 of 7

Thread: How to print a report

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Posts
    5

    Question How to print a report

    Hi there.
    I am making a little system that uses a database in access.
    What I want to do is to generate a printed report in base of the information I get when I do a query.

    I really will appreciate any help!!!

    Thanks..

    PacoL

  2. #2
    Lively Member pegasus's Avatar
    Join Date
    Nov 1999
    Location
    Birmingham, United Kingdom
    Posts
    88

    print...

    well, i suppose u could use Automation to create an access object and then take control by telling it to open a other programa nd eventually to print.

    i can' t remember the Automation code for Access off the top of my head.. I might get back to u on that one.

    ...i think it goes something like this:

    dim q
    set q = CreateObject("[This is the bit i can't remember...]")

    ' and once u have contol of it u can do all sorts of stuff with the
    ' program such as:
    q.visible = false

    hope i helped,

    well, u cant blame a man for hoping...

    pegasus
    Those who say that size doesn't matter, aren't big enough to admit that they're wrong.

    Sex is like a bank account: once you withdraw, you lose interest.

    ______________________________
    Code:
               |^^^^^|
               \-Ó-Ò-/
               | |_| |
                \\_//
             __ |   |__
           /|   \___/  |\
          / |          | \
         /  | Faisal   \  \
        |  /  Karjikar |  |
        \ _\___________|_/
            \         /
            |    \/   |
            |    ||   |
            |____||___|
            \ _ / \ _ /
            /|_|\ /|_|\
     ______ |___| |___| ____
    /_/\/\/\/\/\/\/\/\/\/\/\/\/\//\
    _\/\/\/\/\/\/\/\/\/\/\/\/\/\//\
    /\/\/\/\/\/\/\//\/\/\/\/\/\//\\/\/
    
    ^
    Its meant to be the ocean... :D

  3. #3
    Hyperactive Member Jason Badon's Avatar
    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    329
    this will open datareport1 and print it.


    Cookie = DataReport1.PrintReport(True, rptRangeAllPages)

  4. #4
    New Member
    Join Date
    Jun 2001
    Location
    Chicago
    Posts
    9

    Talking

    Here, this works for me.

    Dim strDbName As String
    Dim objAccess As Access.Application
    Dim strReport As String

    On Error GoTo loaderror
    strDbName = strDbName & "\somedatabase.mdb"
    Set objAccess = CreateObject("Access.Application")
    With objAccess
    .OpenCurrentDatabase filepath:=strDbName
    .DoCmd.OpenReport ReportName:="rptName", _
    view:=Access.acPreview
    End With

    Now, if someone can show me how to do this in a web app without using snapview I will be forever in your debt. (Of course I would rather owe you than cheat you out of it)
    MtnDew55

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Posts
    5
    Thanks to everyone for the help.
    I will try it and let you know if it worked for me.

    PacoL

  6. #6
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    What's about the poor printer function ???

    Printer.print "Hello World !"
    Printer.enddoc

  7. #7
    New Member
    Join Date
    Jun 2001
    Location
    Chicago
    Posts
    9

    Talking

    Aye Captain, Printer.PrintDoc has had to yield to a greater, and much more sophisticated, procedure. It can now be found on many of your finer 286's and 386's.
    MtnDew55

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