Results 1 to 2 of 2
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    code error when using runtime?

    Hi



    suspect I may have dug a deep hole but ....

    I have a running database thats I'm constantly changing as I learn new things.

    I have pdf files that are accessed by buttons and an exit button

    All work on my testing machine but when I open with the runtime version they don't work. THat is what is puzzling me

    The PDFs when called show a runtime error and the exit button causes a total crash.

    The code for the buttons is below would appreciate any thoughts

    thanks

    Ian


    Code:
    Private Sub btn_exit_Click()
    DoCmd.CloseDatabase
    End Sub
    Code:
    Private Sub btn_pdfhelp_Click()
    Application.FollowHyperlink "WsMCemeteryHelpFile.pdf"
    End Sub
    Code:
    Private Sub btn_CemeteryMap_Click()
    Application.FollowHyperlink "CemeteryMap.pdf"
    End Sub
    
    
    
    Private Sub WarGraves_Click()
    Application.FollowHyperlink "WarGraves.pdf"
    End Sub

  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
    With the runtime version, you need error handling to prevent the crash after an error:

    http://www.baldyweb.com/ErrorTrap.htm

    Not sure why the code is failing. I always provide a full path, so you can try that. I also use

    DoCmd.Quit

    to exit the database, so you might try that.
    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. Replies: 4
    Last Post: 10-24-2014, 12:39 PM
  2. Replies: 2
    Last Post: 10-15-2014, 04:23 AM
  3. runtime error code 2427 expression with no value
    By snoopy in forum Programming
    Replies: 8
    Last Post: 06-10-2012, 11:07 PM
  4. RunTime Error 3075, code for search button
    By jacie in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 05:23 AM
  5. Runtime error in preventing duplicates code
    By emilyrogers in forum Access
    Replies: 10
    Last Post: 10-07-2010, 08:14 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