Corrupted form-module ?

T

Thomas Kroljic

I have an Access 2000 application (MDB) with many forms. Each form as a VBA
module behind it. Over the past year or so, I experience a problem with one
specific form. Every once in awhile, if I make a change to the form or the
VBA code behind the form, when I go to run the application, it can not open
the form I just updated. I've tried exporting all the forms, tables,
queries, modules. to another (new) database but I still receive the same
error. I always have to go back to a previous version of the database to
begin again to make (apply) my updates to the form in question and hope that
I don't receive the same error again.



It's as if the form loses its association to the VBA module or the form and
VBA module become corrupt for some reason. Not sure what it is. I've tried
exporting/importing to a new database; I've tried setting the Has Module
status to No for this particular form and then importing the code.



Any suggestions?



The form in question has grown quite a bit over the last year. It would take
some time to create a totally new form with the same functionality. But if
this is what I have to do, so be it.



I've run JetComp against the entire database and still receive the error.



I'm running Access 2000 version 9.0.6926 SP-3



Thank you,

Thomas J. Kroljic
 
G

Guest

It happened to me too.

I thing it's some corrupt pre-processing (posting) of the VB code.

When I got it it helped exporting the code to a text file.
recompiling the database
check the text file for weird characters eventually loading it in notepad
and resaving it to a new file.
reimport the code

AndreG
 
T

Thomas Kroljic

Andre,
Thanks for your response.

How did you go about exporting the VB code? Did you go into the VBA
editor and select file/export? What file type did you save it as?

When you import it back in, what exact steps did you do?

Thanks,
Thomas J. Kroljic
 
M

margaret bartley

Do you have all the updates for Access 2000?
I vaguely seem to recall that this was a known problem that was fixed with
one of the updates.
 
G

Guest

Thomas,

I would just export it as proposed (.cls)
then delete the code module by using "delete" in the Visual basic editor's
property of your form's code (right mouse button).
set the form has module property to no
compact and save the database or even better create a new database and
reimport all (but this form without code).
then reopen and open a blank VB class module for this form by using the
"View", "code" from the menu bar that will open a new clean and empty module
in the VB editor
Check your exported code (.cls) file carefully using a text editor (notepad)
for any weird or foreign characters.
replace the ASCII code text opening it from a text editor (notepad is fine)
using "copy text" and paste into the opened VB editor form's class module
take care not to enter the "attributes" lines (first few lines of the .cls
file).
I hope this will help
good luck
rgds
Andre
 
T

Thomas Kroljic

Margaret,
Thanks for responding. Not sure if I have all the updates. I believe I'm
at SP-3. Do you know if
this is the latest or is there another service pak? I'll check the MS
website.

Thanks,
Thomas J. Kroljic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top