Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to View Code or Open Form

Status
Not open for further replies.

LindaLou

Technical User
Feb 3, 2001
16
0
0
US
Ok...I have a strong idea what might have happened but can't figure how to fix it. Using Access 2000 I was creating a new form based on an old form which already had controls tied to event procedures. I did the old "Save As" and just renamed the new form. I then Renamed the control name on the new form for the button tied to an event procedure. I think I should have just deleted the copied over control button and recreated a new one for the new form but I did not. I then noticed when I tried to close the original form it kept asking if I wanted to save changes. I would say yes but the same dialog box kept popping up asking if I wanted to save changes on the original form. Not sure of the next sequence but I ended up just deleting the old form since I did not need it any longer. I began adding all my new fields and formatting to the new form and everything looked just great. I closed the new form, saved it and now for the life of me I cannot re-open the form in either form or design view. I cannot use the view code button to see the code. Whenever I try to click the form name in the Database Window nothing happens. No error messages...it just will not open the form.

I am not at all familiar with the VB editor or browser but was able to open the code on a form that works and used the object browser to locate my non-functioning form under the Class section. In the Members section I found the suspect Control button listed and was able to view the code from there. Problem is when I try to either edit the code or delete the code for that event procedure from the object browser it generates a Access Error message stating:

The instruction at "0x6503d227" referenced memory at "0x00000017". The memory could not be "read".

Then if I click on Cancel a debug program is supposed to run but I get a Program error message stating an error log has been created and MS ACCESS closes.

I know that I can just recreate the new form totally by scratch if I need to. I am just concerned I may have some code issues now that will impact the rest of my database at some point. Currently all my other forms are working correctly. I would really like to retrieve the form I created if possible though...even if I could just get into design view to copy over my formatting and fields to a new blank form. Any help is appreciated.

I am basically a end user with only a little exp with VB and event procedures. Just enough to get me in trouble I guess.

So in a nutshell:
1. Is there anyway to open my form in design view?
2. Any other ways I can get back into the code for the non-functioning form
4. Where can I find the error log MSACCESS says it generated?
5. AND I really need to know the do's and dont's of making copies of forms with controls. How can I make multiple forms with similar formatting/layouts without running into coding problems? Rename or don't rename controls between forms?

I know I'm asking alot..but will appreciate any insight time allows from those willing to offer.

Thanks in advance
 
Options
1) Create a new, blank database and attempt to import all objects into the database.
2) use the /decompile option to remove interpreted code from the system. Make a copy of your database, and open it with a shortcut including the undocumented /decompile option. You can search the web for Access /decompile and know just as much about it as I do.

HTH
 
Thanks for the response beetee. I will certainly do the search and read up on the decompile issue. Meanwhile based on some other posts I did create a blank database and imported all my objects from the original. What I can now determine is that the source of my problem appears to be a subform which I created and added to the new form. In the new blank database I get the message that Access could not find the subform either because the name was invalid or it referred to a form that doesn't exist. I was able to open the New form in Design view after it gave me the same messages indicating it could not find the subform. Problem is the subform is the one containing the bulk of all my fields and formatting for the new form. Its beginning to look like somehow my subform was corrupted and may in fact not be retrievable to me. If that is the case I will just recreate it. I have made a copy of the original database, with non-functioning forms and will hang on to it just in case I can find a way to retrieve my subform structure. Not sure what happened to cause Access to be unable to find my subform. Would like to prevent a recurrence if I can.

Any more thoughts or ideas welcome.
 
For what it's worth, the reason I found the /decompile switch was that an Access database I was developing became corrupted; when I tried to execute code in the database I got a similar invalid memory address message.

Whilst pursuing the 'copy to a blank database' strategy, I found that one of the modules could not be copied (I forget the exact error message). When I used the decompile option, I was able to copy the module. I use decompile frequently (without any problems) on some very non-trivial applications (albeit on Access 97; we are now in the process of switching to Access XP). It has a pleasing side-effect of reducing the database size. I compact the database after using decompile, then compile the modules.

Anyway, it only takes a moment to create and it may well solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top