Results 1 to 8 of 8
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Autoexec failing to find designated function


    I can't figure out why access can't find a function via Autoexec Run Code? The function is "Public" coded in a general module, like I've been doing for years.

    Click image for larger version. 

Name:	000.jpg 
Views:	11 
Size:	48.7 KB 
ID:	48113

    I must have forgotten something???

  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,521
    Looks okay to me Bill, presuming that's a standard module rather than a form/report module. What error do you get, just "can't find..."?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Public Function MedTimes() coded in ModMedTimes. I get the error with both RUN Autoexec from macro design or open DB.



    Click image for larger version. 

Name:	001.jpg 
Views:	9 
Size:	29.8 KB 
ID:	48114

  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,521
    Does it compile? I'm wondering whether there are 2 functions with the same name. If not, can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Only one instance of "Public Function MedTimes()" and the DB compiles. However, Compress and Repair produce the same error. I have to leave for a bit, but when I get back I will rebuild the DB piece-meal to see if I just have a corrupted DB. Happens sometimes with cut/paste of code and or modules.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    The Runcode should be =MedTimes()

    note the =

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Far be it for me to question my elders, but here's one of my production macros that has run successfully for about 12 years or so.
    Click image for larger version. 

Name:	002.jpg 
Views:	8 
Size:	12.9 KB 
ID:	48115

    I created a new DB and copied the modules, queries and macros plus the backend links. So, as I somewhat expected, I was dealing with some level of corruption within the DB causing the issue. One has to remain astute when using copy/paste within Access, especially code and controls.
    Thanks,
    Bill

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    but here's one of my production macros that has run successfully for about 12 years or so.
    Well, that's a surprise. Turns out it works either way for me.

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

Similar Threads

  1. Access AutoExec Macro Cannot Find Function
    By JuanTooTree in forum Access
    Replies: 10
    Last Post: 06-08-2023, 10:10 AM
  2. Replies: 4
    Last Post: 08-22-2020, 09:31 AM
  3. Replies: 7
    Last Post: 07-04-2020, 07:25 PM
  4. autoexec to execute function at startup not working
    By bbxrider in forum Programming
    Replies: 10
    Last Post: 01-12-2019, 05:50 PM
  5. Replies: 3
    Last Post: 01-08-2013, 11:51 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