Results 1 to 4 of 4
  1. #1
    dircur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2014
    Posts
    2

    Access 2007: Open Module macro action only opens vb editor but doesn't run code?

    I have previously posted this question to another forum but haven't gotten any responses. I understand I should link between the 2. So think link is to my post on the ozgrid forum.


    The macro starts from a form button action, with a bunch of queries to external databases, it's last action is to run a bit of VBA that appends a few lines to a txt file.
    When it runs, all is well up to this open Module command, where it only opens the vb editor to the starting line of the procedure. I am forced to hit play. When I do click play, the sub routine runs without issue.


    I am not sure why it requires my interation to run. This feels like Access has trust issues and won't commit to me . I figured it was a macro security setting or trusted location issue but I think I have set that correctly.
    Once I have the location in the list of trusted locations what else should I be checking.


    I'm totally self taught so I hit the wall on newb stuff all the time.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What exactly is the macro action you used? OpenModule does just (and only) that. I suspect you want RunCode with the name of a public function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dircur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2014
    Posts
    2

    Thanks :)

    Quote Originally Posted by pbaldy View Post
    What exactly is the macro action you used? OpenModule does just (and only) that. I suspect you want RunCode with the name of a public function.
    DERP... I have never blended macros with code before. I noted that Run code was function only and my routine was a sub. I somehow figured Open Module was the "Sub" version of Run code. I've built a function that calls the subroutine and replaced the open module with Run code. Wee!

    Thanks so much.

    ... I have been clicking the play button for months thinking it was some desktop security lock down. A few of the security settings are administratively set. The only reason I am pushing forward was I want to externally automate the process. I am going to write a vbscript to call this synchronization macro and put it on the desktop scheduler.

    I am hoping to get it to a point where I never have to really touch this database.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. context help in VBA editor in Access 2007 is missing
    By OlivierStikkelman in forum Programming
    Replies: 3
    Last Post: 06-25-2014, 10:03 AM
  2. Replies: 0
    Last Post: 07-11-2013, 02:21 PM
  3. Running Code from a Module in a Macro
    By ReadyReckoners in forum Modules
    Replies: 2
    Last Post: 05-08-2013, 04:45 AM
  4. Replies: 1
    Last Post: 05-02-2012, 11:40 AM
  5. Replies: 0
    Last Post: 04-04-2008, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums