Results 1 to 3 of 3

Thread: Calling a Access 97 macro from VB

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    Hampton Beach
    Posts
    513

    Question Calling a Access 97 macro from VB

    I am using Visual Basic 6.0 and I created a macro in access 97 called tester.

    By clicking on a cmd button how can I run this macro from my Visual Basic?

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Look into using the Microsoft Access Object reference!

    You'll be able to do it through that!

    b

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    11
    perhaps this will be helpfull.....

    VB Code:
    1. Set rAcc = CreateObject("Access.Application")
    2.  
    3. rAcc.OpenCurrentDatabase (your_database_path)
    4.  
    5. rAcc.DoCmd.OpenModule "Module1", "SetStartupProperties"
    6. rAcc.Run "SetStartupProperties"

    Where "SetStartupProperties" is a Macro in Module1 of your Access database.

    Don't forget to set reference to Access in your project.

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