Results 1 to 3 of 3
  1. #1
    DavidKond is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Location
    Sherbrooke
    Posts
    1

    Lost VBA Code

    Good morning.

    I would like to know what happens to my Access Database.

    I was creating my tables and forms, day after day. It's not so big, but not so small DB. It's about 50 tables, and 30 forms and subforms (and a couple of Queries).
    It was just in the beggining, those forms are just for browser those tables.
    So, one day, in the morning, I openned my DB Access, and a message appears just telling that I'll lost all my VBA code, but will be possible to recover the tables and forms (without code).

    F...ck...!

    Luckly I didn't make too much code, but, if it happens once, it'll can happens again....

    Which are the possible causes of that?


    During all those days, I didn't change anything in my computer, in the network or in the server.

    Thanks...

    David

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    All one can say is that what you described has never happened to me in years of development. Access is very stable. Noting that you do not provide the official error message number and I've never seen any error message that says it has 'lost all VBA code' - so it isn't really clear what is going on in your situation.

    One can say generically to Compact & Repair - - or since you are starting over ; make a new database and import your tables/queries so you have a new container. But really there can be no advice that I can give in terms of what you describe.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    My sad story.........

    I lost my FE dB... ever so slowly. No error messages. Starting up took longer and longer. Finally, some of the code wouldn't execute. Took me almost 2 and a half weeks to recover. I tried to use the backups (I create backups & backups & backups & ...), but since the corruption happened over a couple of months, all of the recent backup were bad also.

    I was able to use the undocumented command "ExportAsText" (after hours of searching the Net) to recover the code, but creating a new mdb and adding the code didn't fix the corruption. The VBA project was corrupt. So any code added was being added to the corrupt VBA project.

    I finally found one line that seemed to solve my issue (at least the coding issue).... After exporting all of the text, I had to go to EACH form and report and set the "Has Module" property to NO. Any code remaining (standard modules) should be deleted.
    Save the changes.
    Do a compact and repair. Save, close and open the dB.
    Import what is left of the "bad" database - tables, queries, forms and reports to the new database. I never use macros so no problems there.

    Part of the problem was I waited too long between saves. Didn't run compact and repair often enough.
    Another was editing code while the code was executing. I would set a break point and add/delete/comment/edit code while paused.
    BAD programmer!!!! BAD, BAD, BAD!!!

    Now I'm being forced to downgrade to Win 7 and A2010..... I really (to the 10th power) hate the ribbon. A lot of commands I use have disappeared.
    On the other hand, maybe the dB will be more stable.


    And remember the 3 rules of computing:

    1) Back-up
    2) Back-up

    and
    .
    .
    .
    .
    .
    3) Back-up

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

Similar Threads

  1. Totally lost!!
    By JPP in forum Access
    Replies: 7
    Last Post: 02-04-2013, 10:05 AM
  2. Lost Newbie.....Please help.
    By beachbumch in forum Access
    Replies: 3
    Last Post: 06-26-2012, 10:06 AM
  3. Lost Network
    By chessico in forum Access
    Replies: 0
    Last Post: 08-11-2011, 06:10 AM
  4. Replication Lost
    By tak4 in forum Programming
    Replies: 0
    Last Post: 03-17-2010, 11:55 AM
  5. Completly lost...
    By fairytalesrcute in forum Access
    Replies: 1
    Last Post: 05-14-2009, 09:24 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