Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MS Visual Basic Question

  • 14-04-2005 07:46PM
    #1
    Moderators Posts: 5,598 ✭✭✭


    We are trying to open an access report through vb application. We already have bits and peices of code but the declaration of the object does not work(access.application). How exactly do you declare an access database as an object in vb.


    Another way of sloving this problem is opening up an access form with a button.How do you do this. Need to use a frame or code or both?


Comments

  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    Why not use vba?


  • Closed Accounts Posts: 92 ✭✭tempest


    Azza wrote:
    We are trying to open an access report through vb application. We already have bits and peices of code but the declaration of the object does not work(access.application). How exactly do you declare an access database as an object in vb.


    Another way of sloving this problem is opening up an access form with a button.How do you do this. Need to use a frame or code or both?

    Post a couple of lines of code please.

    Dim accessApp As Object
    Set accessApp = CreateObject("Access.Application")
    accessApp.Visible = true
    creates the object dynamically.

    Dim accessApp As Access.Application
    Set accessApp = New Access.Application
    accessApp.Visible = true

    creates the object statically but requires the object to be in the Project -> References section.

    This performs better and gives you autocomplete when you are developing.


Advertisement