Results 1 to 5 of 5

Thread: Print A access report

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27
    Anyone knows how do i print access report
    Tru VB

    I have the report form made all i want to do is by
    command button from my VB app to print it !
    KraMba

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621

    Talking

    Reference the Microsoft Access 8.0 object library
    and place the following code in your command button.

    Code:
    Dim X As New Access.Application
    
    X.DoCmd.OpenReport "ReportName", acViewNormal
    Hope this helps



    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  3. #3
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80
    Ensure you have a reference set to 'Microsoft Access version 8.0'.

    Use the following code:

    Command1_Click

    Dim AccessApp As Access.Application

    Set AccessApp = New Access.Application

    AccessApp.OpenCurrentDatabase "the path to your database..."

    AccessApp.DoCmd.OpenReport "report name"

    end sub.

    Hope this helps.

    Best Regards,

    Rob Brown.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27
    10x a lot
    It Worked
    KraMba

  5. #5
    Lively Member
    Join Date
    Oct 1999
    Posts
    90

    Question

    Will this stuff work if Access (or Office) is not installed on the client machine? Will an install routine (VB's own or InstallShield) include the Microsoft Access 8.0 Object Library with the install and allow the code listed here to run okay without a full version of Access?

    Thanks,
    -JoeyCode

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