Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So I just started playing with Access 2007 to prototype an app.... but at some point in the last 24 hours, the .accdb file no longer lets me open up any VBA code: not with Alt-F11, not with the event on any button, etc. I get the typical Windows application error message, with an offer to repair (which it doesn't) and report the issue (which has gotten boring)

    Compact and Repair: Same Results
    Save As: Same Results
    Office Diagnostics: Nothing found

    Export to another DB worked for all items but one, of course it's the most complex form I put together. I really don't want to rebuild that one from scratch, especially as I had some clever hacks in the that frustrated me for the better part of a couple of afternoons (multiple linked subforms).

    Is there any clever way to get the VBA code behind that form out from the .accdb file? That would really save me a lot of work.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='joelfinkle' post='770538' date='14-Apr-2009 23:53']Export to another DB worked for all items but one[/quote]
    Export to another DB don't work for that one form, but have you try to import it from another DB. I don't know if that can make a difference.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='Francois' post='770540' date='14-Apr-2009 17:00']Export to another DB don't work for that one form, but have you try to import it from another DB. I don't know if that can make a difference.[/quote]
    Good ol' ribbon bar, hiding features from me... but nope, doesn't work. Same crash when I try to import that one form.

    Thanks for the pointer, I'm sure I'll use it, but it didn't fix me here. I guess I'll have to re-engineer the darn thing. I may have a very early version that can give me a jump start, but I doubt it.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='joelfinkle' post='770557' date='15-Apr-2009 13:04']Good ol' ribbon bar, hiding features from me... but nope, doesn't work. Same crash when I try to import that one form.

    Thanks for the pointer, I'm sure I'll use it, but it didn't fix me here. I guess I'll have to re-engineer the darn thing. I may have a very early version that can give me a jump start, but I doubt it.[/quote]
    Says a lot for backups. I tend to save any database i am working on about 1/2 dozen times a day. Still that is not helping you any here.

    Can you convert the 2007 database to 2003? If you can that may save your bacon.

  5. #5
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Are you familiar with the (undocumented, as I understand it) /DECOMPILE command-line switch? If it serves the same function in Access 2007 that it did in prior versions, it might be worth a try. (Save a copy of the database before you try it.)

    You may want to search the Access forum for "decompile" for posts offering more background, but the basic instruction is to open the database from the command line and add /DECOMPILE at the end. For example:

    MSACCESS NameOfMyDatabase.mdb /DECOMPILE
    As I understand it (and remember -- I don't know if this continues to apply for Access 2007), decompiling periodically is apparently good practice for any database that has lots of code, forms, etc. (i.e., typical front-end databases). It both reduces the database's size and, in Charlotte's words, it can "cure some problems you may not even know you had."

    Good luck.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks much everyone:
    1) Saving to 2003 caused a crash, and the 2003-version file still crashed Access 2007 when attempting to open VBA, but it was able to be opened in 2003, and the form and its code examined there
    2) The DECOMPILE switch appeared to repair the file -- a life saver. You'd think that "Compact and Repair" might do that, but nooooooo.

    The root cause? I think it may have been closing the database with a breakpoint set in code. I know this has caused problems for me in previous versions of Word, and at one point the code was breaking there even though the breakpoint wasn't visible -- I was able to stop that behavior with "Clear all breakpoints" but shortly after that the VBA was no longer accessible.

    I've worked with Access much, much less than I have with Word, but I feel I could already write one of Woody's "Annoyances" books.

  7. #7
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'm glad to hear the /DECOMPILE worked for you. Just a follow-up note:

    My notes on /DECOMPILE say that, to really finish the clean-out, after you do the decompile, you should then (1) go to the VBE window and compile the database, and then (2) Compact and Repair.

    At that point, if I understand this correctly, the corruption (which was probably located in a compiled portion of the file) will hopefully have been discarded (and replaced by the freshly-compiled code).

Posting Permissions

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