dcsimg
Results 1 to 12 of 12

Thread: [RESOLVED] Access: AutoExec macro not running

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Resolved [RESOLVED] Access: AutoExec macro not running

    I'm trying to add an AutoExec macro to my Access project.

    I placed it in a standard module, but it is not running when I open the database. I tried defining it as a sub/function but still no luck.

    Also when I go Tools>Macro my only options are 1.VBE and 2. Run Macro
    I chose VBE & I see my standard module. In Run Macro, it is an empty dropdown list.

    What am I doing wrong? Do I need to define it in a special way? How do I enter the AutoExec macro please?

    Thank you

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    Ok I tried renaming the module to AutoExec. Still no Success.
    so i have 2 modules: module 1 and AutoExec

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    Thanks Koolsid
    The problem is that when I select Tools>Macro I only have 2 choices:

    Run Macro & VB Editor (everything else is grayed out)

    It doesn't say "Add New Macro" as stated in the link provided.
    I even tried to open a new dbase to try it. No option to add a new macro.

  4. #4
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: Access: AutoExec macro not running

    All you have to do is select the Macros tab and ccreate a new macro named "AutoExec" as I mentioned. In that macro you can designate what public function you are going to run. Thats it. To run it either close and reopen your database or double click the macro in the macros tab.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    Hello,

    I'm still not getting it.

    In the database window I select Macro, then New. It asks for an ACTION I can't enter the function name - just select from a dropdown list.
    I selected OpenFunction. Where Do I enter the line "Call FunctionName" ?

    Thanks

  6. #6
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: Access: AutoExec macro not running

    What version of Access is this on?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    Im using 2002

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    RobDog,

    I got it to work. My toolbar appeared.

    Only thing is a msgbox comes up when I open the MDB. It says The action or method requires a table name argument. I wasn't getting this before.

    Thanks for your help!!

  9. #9
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: Access: AutoExec macro not running

    Ah Im a little too late but i might as well post what I created anyways.


    Click new macro
    Name:  AutoExec1.png
Views: 6086
Size:  12.3 KB

    Select "RunCode()"
    Click the browse button and location your function
    Name:  AutoExec2.png
Views: 6149
Size:  14.4 KB

    Save macro as "AutoExec"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: Access: AutoExec macro not running

    RobDogg,

    You were not too late. Thanks for taking the time to visualize the solution.

    This works perfectly - no msg box now.

  11. #11
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: [RESOLVED] Access: AutoExec macro not running

    Well i figured it may help someone else too Guess thats what I get for leaving for a while when I should have been posting adictively instead
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Re: [RESOLVED] Access: AutoExec macro not running

    No problems, all is well (for now...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width