Results 1 to 2 of 2

Thread: report generation

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    20

    Lightbulb report generation

    Hi
    my database is in access..and front end is vb....i want to create reports in access....if i do this how can i link these reports to my vb form.....and is there any drawback of making reports in access and using thm through vb form......i need advice
    thnx

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: report generation

    Moved to reporting section.

    Create your reports in Access.

    To call them from VB, set a reference to the Microsoft Access X.X Object Library (where X.X is the version installed on your machine.)

    Then, use code like this:
    VB Code:
    1. Private Sub cmdPrintReport_Click()
    2.           Set Axs = CreateObject("Access.Application")
    3.            Axs.OpenCurrentDatabase (DBPath)
    4.            Axs.DoCmd.OpenReport "MyReport"
    5.            Set Axs = Nothing
    6.            Axs.Quit
    7. End Sub
    Where MyReport is the name of the report that you have previously created in Access.

    I don't see drawbacks. I've used Access reports from VB before with great success.

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