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

    Module compiles, exicutes okay but can't create accde

    I have a simple "Public Function" that compiles without errors and runs correctly without errors. (The Run Code macro is AutoExec)



    Click image for larger version. 

Name:	000.jpg 
Views:	34 
Size:	11.0 KB 
ID:	45100 Click image for larger version. 

Name:	001.jpg 
Views:	34 
Size:	26.8 KB 
ID:	45101

    I "Run to Cursor" in debug with a test sub and all works as expected.
    Code:
    Public Sub TestMedCheck()
    Call MedCheck(0)
    End Sub
    If I try to "Open" the accdb or create a accde, I get an error Access can't find a macro. Same thing with "Compress & Repair"

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Make sure you have Option Explicit listed at the top of each code module to ensure all variables are declared.
    Now run Debug...Compile again and fix any errors.
    Once that is done, you should be able to create an ACCDE
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    ALL my general and form modules head with:
    Code:
    Option Compare Database
    Option Explicit
    Why I get this with make accde and compress and repair is still a mystery to me.
    Click image for larger version. 

Name:	002.jpg 
Views:	30 
Size:	19.7 KB 
ID:	45103

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    It's probably some other function that you've forgotten about. Maybe one called by some query or control?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    That's what I thought at first, but I've scoured the code and as yet haven't found it. I'll take a nap and then look again

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Could always submit the db for additional inspection, but enjoy your nap. Maybe you'll come up with some ideas in your dreams.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Is the module name the same as the public function (MedCheck)? If yes then that is your problem.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    No, I use a type prefix on all my stuff, like Mod, frm, rpt,tbl, Q, etc. So the module name is ModMedCheck while the function name is MedCheck. Same with variables, str, lng, int, var, etc.

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I think I've attached the zipped DB? (It's okay if you run the code, as the only outcome would be for me to receive a text message, just limit such to the continental US.)
    Attached Files Attached Files

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I just got a text
    and another

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Must have been me. Didn't realize that would occur and have no idea at what point.
    I first tried importing all into a new db - no dice.
    I tried removing function, closing, decompiling, opening, pasting back in and compiling - no dice.
    The only thing that seems to work is calling TestMed instead. At this point I'm stumped because besides all of that I made sure it was a function call and that it was public in a standard module. I also tried calling my own function with text and long variables and that worked.
    Also created a new macro and tried calling MedCheck - no dice. Changed function name to Med and that worked in my new macro.
    Changed your function name to Med and it works - Med(0)
    It doesn't like the name MedCheck!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    VERY BIZARRE! It will work as MedChk(0) and MedChek(0) but not MedCheck(0). It's as if it's rejecting Check as a reserved word.
    That's GOT to be a bug.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    MedChk gets the job done. I've never run into a goofy one such as this caper has proven to be. I know solving it wasn't without some effort on your part, so I thank you!

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    You're welcome. It's not one I'm likely to forget for a while.
    With a bit more testing I figure it's not the length of the name by any means. MedChekk was OK too, and when I reverted it back to MedCheck all of a sudden the function name was presented when I began to type Med in the macro field, which it never did before. I thought "Here we go, it's going to work." Still failed. Tell Bill next time you see him.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    That's GOT to be a bug
    Sure seems that way to me.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 12-17-2020, 08:55 PM
  2. Create ACCESS 2013 from ACCDB to ACCDE
    By johnseito in forum Access
    Replies: 30
    Last Post: 08-08-2018, 02:35 PM
  3. This code compiles but does not work
    By Lou_Reed in forum Access
    Replies: 6
    Last Post: 10-21-2016, 12:53 PM
  4. Programmatically create a ACCDE
    By srbond@hotmail.com in forum Programming
    Replies: 2
    Last Post: 11-18-2010, 08:00 AM
  5. Cannot create ACCDE file
    By swilliams in forum Access
    Replies: 1
    Last Post: 06-03-2010, 03:41 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