Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a database that unforunately was not planne dout very well because with all of the changing needs of the company, things were added and dropped a lot. I would like to start the new year out with a clean database, which only used the tables, queries and forms that are currently in use. I've started a new database and have imported everything that I need. None of the command buttons on the forms are working though. Is there something that I have to do to copy all of the event procedures over also?

    I've tried to copy and paste some of the command code from the old database but it says, "The action will reset your project, proceed anyway? I click okay and then is says, "Can't perform requested operation.

    I've gone to a blank new form and this is what I get when I try to add a close button.

    The expression On Click you entered as the event property setting produced the following error: Error accessing file. Network connection may have been lost.
    *The expression may not result in the name of the macro, the name of a user-defined function, or [Event Procedure].
    *There may have been an error evaluating the function, event, or macro.

    I'm currently on the network so every thing seems to be working fine there...not sure what this means or why none of my events are working...

    Any assistance you can offer will be appreciate.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    It sounds like you may have an issue with the VBA project in your old database, but it also sounds like something odd happened with the importing of forms. Importing a form should bring in the code for any forms that use event procedures. I take it you created a new empty database, but it is important to know what version of Access you are using - 2007 in particular introduces a number of new wrinkles. When I encounter this sort of situation, I try going to the old database and exporting forms one at a time to see if I find one that is corrupted. Another strategy is to import half the forms and see if things seem to work for those forms. Then try half of the remaining forms, etc. It's tedious at best, but beats designing a new form from scratch. If all else fails you may have to do that however. Another question - is your database split, and if so what is the back-end - Access, SQL Server, or ...?
    Wendell

  3. #3
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using Access 2000. I have not split the database.

    I tried exporting a group of forms and the command buttons still aren't working. I imported the tables and queries though. Was that okay?
    When down to one of the on click event procedures to see if there was anything there and the screen is blank. (screen shot attached) Perhaps there is something that I need to turn on. I just don't know!

    I'm not sure where to go from here.

  4. #4
    Star Lounger
    Join Date
    Jan 2010
    Location
    Oregon
    Posts
    61
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Yikes, sorry to hear this. Here are some suggestions, hope they help. (BTW, you referenced an attached screen shot but I didn't see one).

    * Make sure you're not dealing with a networked copy of the app that people are accessing. Make sure you have exclusive access to the app.

    * Try DECOMPILING the app:
    1. Make a copy of the mdb file while Access is not running
    2. Compact the database: Tools | Database Utilities | Compact
    3. Close Access. Open a command prompt, and enter something like this. It is one line, and include the quotes:
      "C:\Program Files\Microsoft Office\Office\MSAccess.exe" /decompile "C:\My Documents\MyDatabase.mdb"
    4. Compact again
    5. Try your import/export again

    * Read this KB article carefully. You MUST make sure ALL computers have the latest service packs.

    * Import it into Access 2003 and hope it transfers everything properly

  5. #5
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I'm pretty lost.

    Working first with your post, #3 How do I "Open a command prompt? Is that in explorer? If so, am I correct in assuming, I'll be changing the last part to: N:\My Documents\Projects\Access\Quote\Test Area\db3.mdb, which is the location of my database?

    Trying to understand the link...Resolution #2 I don't know how to "save the code behind the form..." Actually none of it was very clear but it might make more sense once I see how to save the code...

  6. #6
    Star Lounger
    Join Date
    Jan 2010
    Location
    Oregon
    Posts
    61
    Thanks
    9
    Thanked 0 Times in 0 Posts
    No worries. This can be very confusing. Regarding the decompile, just make sure you're working with a COPY of the Access app, which it seems you are given that one of your folders is named "Test Area."

    To get to a command prompt, click Start, Run, then type "cmd" and press Enter. You should now be at a DOS command prompt.
    You want to enter the following:
    <Full path to your local copy of MS Access> /decompile <Full path to your Access database file>
    Thus, in your case, you should enter the following, including the quotes, assuming Access/Office is installed in the normal place (if not, modify the first path as needed):

    "C:\Program Files\Microsoft Office\Office\MSAccess.exe" /decompile "N:\My Documents\Projects\Access\Quote\Test Area\db3.mdb"

    You can actually paste the whole string into your DOS window. Just click on the little icon in the upper left corner of the DOS window, click Edit, then Paste. Once done, try importing the objects from the decompiled file (db3.mdb) into a new database. (Note, just type Exit at the DOS prompt to close the window.)

    When you import objects into a new database, the code behind the forms should just be there. You shouldn't need to do anything special to save the code. Make sure you import all the Module objects (if any) in case the code resides there. The other gentleman was correct: if you import objects and the code is missing, something is terribly wrong. This seems to be a known issue with earlier, unpatched versions of Access 2000, so make sure you have all the latest updates.

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Another way to achieve the same result is to create a desktop shortcut with the /decompile switch.

    • Create a desktop shortcut to the db by right clicking on it and choose "Send to desktop"
    • If you right click on this new shortcut , and look at its properties, you will see a Target. Initially the Target will just have the path to the database.
    • Edit the target by putting in the full path to Access before it, and also the /decompile switch. I put that at the end so it is easy to see that it is there.
    Code:
    "C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE" D:\john\Access\samples\sample.mdb /decompile
    NB The path to Access will depend on the version of Access and the version of Windows.
    Regards
    John



Posting Permissions

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