Results 1 to 7 of 7
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Upon opening Access - Run a program or function

    I thought I know how to do this. I know the concept but it didn't work.

    I created a macro, name is autoexec (so when access is open it auto run) then assign this macro to run a code or function that I build.

    I tried it but it didn't work, not sure why.

    I get the error message
    Microsoft Access cannot find the name fxup you entered in the expression.
    You may have specified a control that wasn't on the current object without specifying the correct form or report context.
    The name is correct and is there and is a function in a module.



    Please advise !

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is it a Public Function in a Standard Module (not the class module of a form).

  3. #3
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    You know how you go to the top and in the menu bar you click insert and you could select procedure, module or class module.
    I entered Module and inside this module I created a public function.

    The module however I rename to let's say abb because I was able to do so. I have the macro call or run the name of this function.

    So yes is a public Function in a standard module - not class module.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So it is now fixed and working?

  5. #5
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    no - still has that error message every time I run the macro or when I open access.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Attachment 29853

    If the name of your function is fcnStartup, here's how to code the autoexec macro.

  7. #7
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Ok that work. I just didn't have the two parentheses. Thanks !!!

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

Similar Threads

  1. Replies: 15
    Last Post: 08-12-2014, 12:35 AM
  2. ACCESS Program
    By johnseito in forum Access
    Replies: 33
    Last Post: 08-09-2014, 08:24 AM
  3. Replies: 3
    Last Post: 08-04-2013, 10:53 AM
  4. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 PM
  5. Is Access the right program for me?
    By Cole in forum Access
    Replies: 1
    Last Post: 08-07-2010, 08:47 AM

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