Results 1 to 3 of 3

Thread: Running Access Module code

  1. #1

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Is it possible to execute code in an Access module from a VB front-end?

    (Please let it be YES!)

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company



  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post


    Add reference to Microsoft Access 8/9 Object library

    This executes a sub in an MS Access module:

    Be sure your method (in the Access module) is declared as PUBLIC

    Code:
        'declare objects
        Dim axs As Access.Application
        Set axs = New Access.Application
        
        'open database
        axs.OpenCurrentDatabase "C:\Nwind2k.mdb"
        
        'call PUBLIC helloworld subroutine
        axs.Run "HelloWorld"
        
        'release object
        axs.CloseCurrentDatabase
        Set axs = Nothing
    HTH

    Tom

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    I've done it in Excel, I'd expect the anser to be yes for Access.

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