Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Module Corruption (Acces2 2007)

    Hey All

    I have had this problem twice. The first time I started work again on the form that corrupted. Hours and hours of work later, now it's happened again, I'm reluctant to repeat all that work until I know what is going wrong. I have backups I've made on the way so it's not like all is lost, but the big picture problem of why remains.

    The database is accdb format. The faulty form contains three subforms - not linked to the main form, or each other. The three subforms and their code run fine.

    The last time I worked, the form and the database closed without incident. Now the database opens ok, but when I open the faulty form, I get "Microsoft Office Access has encountered a problem and needs to close." - I'm offered the chance to repair the database - this does not fix the problem.

    I can design the form - Ok. When I click to show the Code behind this form - or ANY code behind ANY form or code module - I get the same crash. I can open other forms with code and the forms open and the code runs. But if I try to edit the code behind the working forms - crash.

    I can't import the failed form into another database - the new database crashes during the import process. However I can import all the other objects from the database and they run fine. If I go into the faulty form's properties and select "No" to the Has Module property, I'm warned that this action will delete all the code behind the form. If I accept that, the form is now restored to functioning (albeit with no code!) and I can add my code and go on. I can then edit the code behind all the other forms and modules as well.

    In short - I believe it's just this one form's module that has a problem. I need two solutions. (a) can I recover the module in some way, so I don't have to re-write all my code (which after the second complete re-write, is very good code); ([img]/forums/images/smilies/cool.gif[/img] Why is this happening? Should I go back to 2003 format, or 2003 Access? Argh!

    Thanks - Merry Christmas All.

    Regards Ken Pascoe (ken.pasce [AT] gmail.com)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Module Corruption (Acces2 2007)

    I don't have Access 2007 so I have no idea whether it will work, but take a look at <post:=247,983>post 247,983</post:>. Replace Employees with the name of your problem form.

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Module Corruption (Acces2 2007)

    Hi Hans - Thanks for the reply.

    Unfortunately I cannot open the module associated with the corrupted form. I can design the form, but as soon as I launch the VBE (for that form, or any other form - even if the bad form is not open - or for a module) - Access 2007 crashes.

    For now I'm going to start the form from scratch, and backup regularly. I'm also going to work in Access 2007 but use the 2003 database format.

    Regards Ken

  4. #4
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Module Corruption (Acces2 2007)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Howdy All

    I've done some hunting, and while I haven't worked out why, decompiling the accdb file fixed my problem. Details can be found at http://www.trigeminal.com/usenet/usenet004.asp

    Regards Ken

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Module Corruption (Acces2 2007)

    Decompile can be very useful.

    Glad you found a solution, and thanks for sharing it.

Posting Permissions

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