Results 1 to 3 of 3

Thread: Vb and MS Access 97

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    1

    Talking

    Hi Everybody

    How can I run a report from Ms Access 97 in a VB 6 application?

    Thanks for the Info
    Clyde

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    29
    this should do it - the "id = 5" bit means it will only print the report for any records where the id field (a field called id) is = 5

    the acNormal bit means it will print, acPreview means just view

    get back to me if this does not help

    Dim stDocName As String
    Dim accApp As Access.Application

    Set accApp = New Access.Application

    accApp.OpenCurrentDatabase (App.Path & "\database.mdb")

    stDocName = "My Access Report"

    accApp.DoCmd.OpenReport stDocName, acNormal, , _
    "ID = 5" 'add query statement here if you want

    accApp.CloseCurrentDatabase

  3. #3
    Junior Member
    Join Date
    Mar 2000
    Posts
    29
    I don't know if you can do that - you would need the MSAccess 8.0 object on your system. If you can get that without installing Access then you probably can. Although any time you open a report in Access (even just to print it) it opens Access itself for a second. So no would be my final guess. You could always use the new report designer in VB6.0 - it is similar to Access, but none of the handy wizards. Thems are my thoughts for what they are worth.

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